Skip to content

Commit 719b21b

Browse files
committed
Try running script from working directory
1 parent e93577c commit 719b21b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/toolchains.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,19 @@ impl Toolchain {
238238
.join(&format!("target-{}", self.rustup_name())),
239239
);
240240
}
241+
let mut script = cfg.args.script.clone();
242+
if let Some(path) = &script {
243+
if !path.is_absolute() && !path.starts_with("./") && !path.starts_with(".\\") {
244+
if let Ok(mut dir) = std::env::current_dir() {
245+
dir.push(path);
246+
if dir.exists() {
247+
script = Some(dir)
248+
}
249+
}
250+
}
251+
}
241252

242-
let mut cmd = match (cfg.args.script.as_ref(), cfg.args.timeout) {
253+
let mut cmd = match (script, cfg.args.timeout) {
243254
(Some(script), None) => {
244255
let mut cmd = Command::new(script);
245256
cmd.env("RUSTUP_TOOLCHAIN", self.rustup_name());

0 commit comments

Comments
 (0)