aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-config/src/shell/bash.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-02-15 19:07:08 +0000
committerGitHub <noreply@github.com>2024-02-15 19:07:08 +0000
commit20f329646894e11e47e7e516b076fa23976c0d5a (patch)
treefc0add6e23c4a4a8fd4ae85520aafc5576848590 /atuin-config/src/shell/bash.rs
parentfeat: add 'ignored_commands' option to stats (#1722) (diff)
downloadatuin-20f329646894e11e47e7e516b076fa23976c0d5a.zip
feat: support syncing aliases (#1721)
* feat: support syncing aliases This is definitely not yet finished, but works for zsh right now. TODO: 1. Support other shells 2. Cache the alias generation, so we don't have to do a bunch of work at shell init time * correct imports * fix clippy errors * fix tests * add the other shells * support xonsh * add delete * update rust, then make clippy happy once more * omfg fmt too
Diffstat (limited to 'atuin-config/src/shell/bash.rs')
-rw-r--r--atuin-config/src/shell/bash.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/atuin-config/src/shell/bash.rs b/atuin-config/src/shell/bash.rs
new file mode 100644
index 00000000..c5bd87b2
--- /dev/null
+++ b/atuin-config/src/shell/bash.rs
@@ -0,0 +1,12 @@
+use super::Alias;
+
+// Configuration for bash
+pub fn build(aliases: &[Alias]) -> String {
+ let mut config = String::new();
+
+ for alias in aliases {
+ config.push_str(&format!("alias {}='{}'\n", alias.name, alias.value));
+ }
+
+ config
+}