Skip to content

Commit c00c27a

Browse files
committed
Change config paths to only check CARGO_HOME for cargo-script
Signed-off-by: Rustin170506 <29879298+Rustin170506@users.noreply.github.com>
1 parent edd36eb commit c00c27a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/bin/cargo/commands/run.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,8 @@ pub fn exec_manifest_command(gctx: &mut GlobalContext, cmd: &str, args: &[OsStri
171171

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

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

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

0 commit comments

Comments
 (0)