Skip to content

Commit

Permalink
Dont save home when just running a binary
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Mar 25, 2024
1 parent 00fc6fc commit 074f704
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,15 @@ impl Runner {
let alias = ToolAlias::from_str(&self.exe_name)?;

let home = Home::load_from_env().await?;
let spec = discover_closest_tool_spec(&home, &alias)
.await
.with_context(|| format!("Failed to find tool '{alias}'"))?;

let result = async {
let spec = discover_closest_tool_spec(&home, &alias)
.await
.with_context(|| format!("Failed to find tool '{alias}'"))?;
let path = home.tool_storage().tool_path(&spec);
let args = args().skip(1).collect::<Vec<_>>();
anyhow::Ok(run_interruptible(&path, &args).await?)
}
.await;

home.save().await?;
let path = home.tool_storage().tool_path(&spec);
let args = args().skip(1).collect::<Vec<_>>();

exit(result?);
let code = run_interruptible(&path, &args).await?;
exit(code);
}
}

Expand Down

0 comments on commit 074f704

Please sign in to comment.