Skip to content

Commit c3f9665

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

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/toolchains.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,9 @@ 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.args.script.as_ref().map(|script| {
242+
std::env::current_dir().unwrap().join(script)
243+
});
252244

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

0 commit comments

Comments
 (0)