Skip to content

Commit 3180735

Browse files
committed
Simplify locating script
1 parent 471668e commit 3180735

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/toolchains.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,11 @@ 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.is_file() {
247-
script = Some(dir)
248-
}
249-
}
250-
}
251-
}
241+
let script = cfg
242+
.args
243+
.script
244+
.as_ref()
245+
.map(|script| std::env::current_dir().unwrap().join(script));
252246

253247
let mut cmd = match (script, cfg.args.timeout) {
254248
(Some(script), None) => {

0 commit comments

Comments
 (0)