diff --git a/README.md b/README.md index b9456a8..015763d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ fluentci run --wasm kamal help | redeploy | Deploy app to servers without bootstrapping servers, starting Traefik, pruning, and registry login | | registry | Login and -out of the image registry | | remove | Remove Traefik, app, accessories, and registry session from servers | -| rolback | Rollback app to VERSION | +| rollback | Rollback app to VERSION | | server | Bootstrap servers with curl and Docker | | setup | Setup all accessories, push the env, and deploy app to servers | | traefik | Manage Traefik load balancer | diff --git a/src/helpers.rs b/src/helpers.rs index abd3a8b..dcfe689 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -19,11 +19,6 @@ pub fn setup() -> Result<(), Error> { let home = dag().get_env("HOME")?; let path = dag().get_env("PATH")?; - dag().set_envs(vec![( - "PATH".into(), - format!("{}/.local/bin:{}", home, path), - )])?; - setup_flox()?; dag() .pipeline("setup kamal")? @@ -31,9 +26,15 @@ pub fn setup() -> Result<(), Error> { .with_exec(vec!["flox install ruby"])? .with_exec(vec!["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 || true", - ])? + .with_exec(vec!["ln -s `flox activate -- gem environment gemhome`/bin/kamal $HOME/.local/bin/kamal || true"])? + .with_exec(vec!["PATH=$HOME/.local/bin:$PATH", "type", "kamal"])? + .with_exec(vec!["type", "ruby"])? .stdout()?; + + dag().set_envs(vec![( + "PATH".into(), + format!("{}/.local/bin:{}", home, path), + )])?; + Ok(()) }