aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/init.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command/init.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/command/init.rs b/src/command/init.rs
new file mode 100644
index 00000000..022021d0
--- /dev/null
+++ b/src/command/init.rs
@@ -0,0 +1,19 @@
+use std::env;
+
+use eyre::{eyre, Result};
+
+fn init_zsh() {
+ let full = include_str!("../shell/atuin.zsh");
+ println!("{}", full);
+}
+
+pub fn init() -> Result<()> {
+ let shell = env::var("SHELL")?;
+
+ if shell.ends_with("zsh") {
+ init_zsh();
+ Ok(())
+ } else {
+ Err(eyre!("Could not detect shell, or shell unsupported"))
+ }
+}