Skip to content

Commit 5eb20f4

Browse files
committed
Do not exit prematurely if anything failed installing.
#9180
1 parent 1ca930b commit 5eb20f4

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/cargo/ops/cargo_install.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,15 @@ pub fn install(
119119
// able to run these commands.
120120
let dst = root.join("bin").into_path_unlocked();
121121
let path = env::var_os("PATH").unwrap_or_default();
122-
for path in env::split_paths(&path) {
123-
if path == dst {
124-
return Ok(());
125-
}
126-
}
122+
let dst_in_path = env::split_paths(&path).any(|path| path == dst);
127123

128-
config.shell().warn(&format!(
129-
"be sure to add `{}` to your PATH to be \
124+
if !dst_in_path {
125+
config.shell().warn(&format!(
126+
"be sure to add `{}` to your PATH to be \
130127
able to run the installed binaries",
131-
dst.display()
132-
))?;
128+
dst.display()
129+
))?;
130+
}
133131
}
134132

135133
if scheduled_error {

0 commit comments

Comments
 (0)