Skip to content

Commit

Permalink
Merge pull request #554 from moonbitlang/node_cmd
Browse files Browse the repository at this point in the history
internal: use node.cmd for windows
  • Loading branch information
Young-Flash authored Jan 13, 2025
2 parents 8a8308c + 4e81079 commit b862bc9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/moonbuild/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tempfile.workspace = true
ctrlc.workspace = true
dissimilar.workspace = true
line-index.workspace = true
which.workspace = true
home.workspace = true
tokio.workspace = true
self-replace.workspace = true
Expand Down
7 changes: 6 additions & 1 deletion crates/moonbuild/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ pub fn run_wat(path: &Path, args: &[String], verbose: bool) -> anyhow::Result<()
}

pub fn run_js(path: &Path, args: &[String], verbose: bool) -> anyhow::Result<()> {
run(Some("node"), path, args, verbose)
let node = if which::which("node.cmd").is_ok() {
Some("node.cmd")
} else {
Some("node")
};
run(node, path, args, verbose)
}

pub fn run_native(path: &Path, args: &[String], verbose: bool) -> anyhow::Result<()> {
Expand Down
7 changes: 6 additions & 1 deletion crates/moonbuild/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ pub async fn run_js(
file_test_info_map: &FileTestInfo,
verbose: bool,
) -> anyhow::Result<Vec<Result<TestStatistics, TestFailedStatus>>> {
let node = if which::which("node.cmd").is_ok() {
Some("node.cmd")
} else {
Some("node")
};
run(
Some("node"),
node,
path,
target_dir,
&[serde_json_lenient::to_string(args).unwrap()],
Expand Down

0 comments on commit b862bc9

Please sign in to comment.