From acd5a9466402ee458c997e9584806d1705a7a677 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Mon, 18 Aug 2025 13:28:36 -0400 Subject: [PATCH] fix: change to home dir before installing Ahoy --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ea1dde2..ad0d65e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,7 @@ fn main() -> Result<()> { if ans { let sh = Shell::new()?; + let username = cmd!(sh, "whoami").read()?; println!( "\n{} Running {} and {}...", "1.".if_supports_color(Stdout, |t| t.style(step_style)), @@ -80,7 +81,6 @@ fn main() -> Result<()> { "✅ 2. Successfully installed curl and enabled SSH." .if_supports_color(Stdout, |t| t.style(success_style)) ); - let username = cmd!(sh, "whoami").read()?; let dpkg_l_output = cmd!(sh, "dpkg -l").read()?; let has_docker = cmd!(sh, "grep docker") @@ -121,6 +121,7 @@ fn main() -> Result<()> { "\n{} Installing Ahoy...", "4.".if_supports_color(Stdout, |t| t.style(step_style)), ); + sh.change_dir(format!("/home/{username}")); cmd!(sh, "sudo curl -LO https://github.com/ahoy-cli/ahoy/releases/download/v2.5.0/ahoy-bin-linux-amd64").run()?; cmd!(sh, "mv ./ahoy-bin-linux-amd64 ./ahoy").run()?; cmd!(sh, "sudo chmod +x ./ahoy").run()?;