Skip to content

Commit 635159b

Browse files
committed
fix: node script invocation on windows
1 parent 876b797 commit 635159b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

rewatch/src/build.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,17 +554,24 @@ pub fn build(
554554
}
555555
}
556556

557-
pub fn pass_through_legacy(args: Vec<OsString>) -> i32 {
557+
pub fn pass_through_legacy(mut args: Vec<OsString>) -> i32 {
558558
let project_root = helpers::get_abs_path(Path::new("."));
559559
let workspace_root = helpers::get_workspace_root(&project_root);
560560

561561
let rescript_legacy_path = helpers::get_rescript_legacy(&project_root, workspace_root);
562562

563-
let status = std::process::Command::new(rescript_legacy_path)
563+
args.insert(0, rescript_legacy_path.into());
564+
let status = std::process::Command::new("node")
564565
.args(args)
565566
.stdout(Stdio::inherit())
566567
.stderr(Stdio::inherit())
567568
.status();
568569

569-
status.map(|s| s.code().unwrap_or(1)).unwrap_or(1)
570+
match status {
571+
Ok(s) => s.code().unwrap_or(0),
572+
Err(err) => {
573+
eprintln!("Error running the legacy build system: {err}");
574+
1
575+
}
576+
}
570577
}

rewatch/tests/legacy.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ cd ../testrepo/packages/compiled-by-legacy
33

44
bold "Test: It should use the legacy build system"
55

6-
rewatch_legacy
76
error_output=$(rewatch_legacy 2>&1 >/dev/null)
87
if [ $? -ne 0 ];
98
then

0 commit comments

Comments
 (0)