Skip to content

Commit 52e9a6d

Browse files
fix: Make CMD handle quotes " properly. (#3334)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
1 parent 343ea3e commit 52e9a6d

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cli.rs": patch
3+
---
4+
5+
On Windows, Fix `beforeDevCommand` and `beforeBuildCommand` not executing the expected command if it contains quotes. This is done by executing them with `CMD /S /C {command}` instead of `CMD /C {command}` on Windows.

tooling/cli.rs/src/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub fn command(options: Options) -> Result<()> {
7575
#[cfg(target_os = "windows")]
7676
execute_with_output(
7777
Command::new("cmd")
78+
.arg("/S")
7879
.arg("/C")
7980
.arg(before_build)
8081
.current_dir(app_dir())

tooling/cli.rs/src/dev.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub fn command(options: Options) -> Result<()> {
108108
logger.log(format!("Running `{}`", before_dev));
109109
#[cfg(target_os = "windows")]
110110
let child = Command::new("cmd")
111+
.arg("/S")
111112
.arg("/C")
112113
.arg(before_dev)
113114
.current_dir(app_dir())

0 commit comments

Comments
 (0)