Prechádzať zdrojové kódy

fix: Make CMD handle quotes `"` properly. (#3334)

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
philipborg 3 rokov pred
rodič
commit
52e9a6d81a

+ 5 - 0
.changes/windows-modify-cmd-string-behaviour.md

@@ -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 - 0
tooling/cli.rs/src/build.rs

@@ -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())

+ 1 - 0
tooling/cli.rs/src/dev.rs

@@ -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())