Skip to content

Commit

Permalink
Change config paths to only check CARGO_HOME for cargo-script
Browse files Browse the repository at this point in the history
Signed-off-by: Rustin170506 <[email protected]>
  • Loading branch information
Rustin170506 committed Oct 30, 2024
1 parent edd36eb commit c00c27a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/bin/cargo/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,8 @@ pub fn exec_manifest_command(gctx: &mut GlobalContext, cmd: &str, args: &[OsStri

let manifest_path = root_manifest(Some(manifest_path), gctx)?;

// Treat `cargo foo.rs` like `cargo install --path foo` and re-evaluate the config based on the
// location where the script resides, rather than the environment from where it's being run.
let parent_path = manifest_path
.parent()
.expect("a file should always have a parent");
gctx.reload_rooted_at(parent_path)?;
// Reload to cargo home.
gctx.reload_rooted_at(gctx.home().clone().into_path_unlocked())?;

let mut ws = Workspace::new(&manifest_path, gctx)?;
if gctx.cli_unstable().avoid_dev_deps {
Expand Down

0 comments on commit c00c27a

Please sign in to comment.