Skip to content

Commit

Permalink
fix: Make CMD handle quotes " properly. (#3334)
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
  • Loading branch information
philipborg and amrbashir committed Feb 6, 2022
1 parent 343ea3e commit 52e9a6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/windows-modify-cmd-string-behaviour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.rs": patch
---

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.
1 change: 1 addition & 0 deletions tooling/cli.rs/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub fn command(options: Options) -> Result<()> {
#[cfg(target_os = "windows")]
execute_with_output(
Command::new("cmd")
.arg("/S")
.arg("/C")
.arg(before_build)
.current_dir(app_dir())
Expand Down
1 change: 1 addition & 0 deletions tooling/cli.rs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub fn command(options: Options) -> Result<()> {
logger.log(format!("Running `{}`", before_dev));
#[cfg(target_os = "windows")]
let child = Command::new("cmd")
.arg("/S")
.arg("/C")
.arg(before_dev)
.current_dir(app_dir())
Expand Down

0 comments on commit 52e9a6d

Please sign in to comment.