diff --git a/src/helpers.rs b/src/helpers.rs index b94ebfc..560d05e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -28,14 +28,11 @@ pub fn setup() -> Result<(), Error> { dag() .pipeline("setup kamal")? .flox()? - .with_exec(vec!["flox", "install", "ruby"])? - .with_exec(vec!["gem", "install", "kamal"])? + .with_exec(vec!["type ruby /dev/null 2> /dev/null || flox install ruby"])? + .with_exec(vec!["type kamal /dev/null 2> /dev/null || gem install kamal"])? .with_exec(vec!["[ -d $HOME/.local/bin ] || mkdir -p $HOME/.local/bin"])? .with_exec(vec![ - "ln", - "-s", - "`gem environment gemhome`/bin/kamal", - "$HOME/.local/bin/kamal", + "[ -f $HOME/.local/bin/kamal ] || ln -s `gem environment gemhome`/bin/kamal $HOME/.local/bin/kamal", ])? .stdout()?; Ok(())