Skip to content

Commit f225473

Browse files
committed
rebar3.cmd
1 parent fb8c476 commit f225473

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

crates/erlang_service/build.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ fn main() {
2424
.expect("Copying precompiled erlang service escript failed");
2525
} else {
2626
let profile = env::var("PROFILE").unwrap();
27-
let output = Command::new("rebar3")
27+
28+
let mut cmd = if cfg!(target_os = "windows") {
29+
let mut cmd = Command::new("cmd");
30+
cmd.args(["/C", "rebar3"]);
31+
cmd
32+
} else {
33+
Command::new("rebar3")
34+
};
35+
36+
let output = cmd
2837
.arg("escriptize")
2938
.env("REBAR_PROFILE", &profile)
3039
.env("REBAR_BASE_DIR", &dest_dir)

crates/project_model/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,15 @@ impl Project {
980980
rebar_setting.config_file
981981
);
982982
let rebar_version = {
983-
let mut cmd = Command::new("rebar3");
983+
984+
let mut cmd = if cfg!(target_os = "windows") {
985+
let mut cmd = Command::new("cmd");
986+
cmd.args(["/C", "rebar3"]);
987+
cmd
988+
} else {
989+
Command::new("rebar3")
990+
};
991+
984992
cmd.arg("version");
985993
utf8_stdout(&mut cmd)?
986994
};

crates/project_model/src/rebar.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ impl RebarConfig {
7171
static ref REBAR_GLOBAL_LOCK: Mutex<()> = Mutex::new(());
7272
}
7373
let guard = REBAR_GLOBAL_LOCK.lock();
74-
let mut cmd = Command::new("rebar3");
74+
75+
let mut cmd = if cfg!(target_os = "windows") {
76+
let mut cmd = Command::new("cmd");
77+
cmd.args(["/C", "rebar3"]);
78+
cmd
79+
} else {
80+
Command::new("rebar3")
81+
};
82+
7583
cmd.arg("as");
7684
cmd.arg(&self.profile.0);
7785
if let Some(parent) = self.config_file.parent() {

0 commit comments

Comments
 (0)