]> git.lizzy.rs Git - rust.git/commitdiff
Add extra double quotes only on Windows.
authorEmil Lauridsen <mine809@gmail.com>
Wed, 3 Apr 2019 08:38:18 +0000 (10:38 +0200)
committerEmil Lauridsen <mine809@gmail.com>
Wed, 3 Apr 2019 08:38:18 +0000 (10:38 +0200)
As tested by @edwin0cheng, Windows requires the quotes removed in the
previous commit. This commit re-adds the quotes gated by an if statement
on the node environment, so that quotes are only added on Windows.

editors/code/src/commands/cargo_watch.ts

index 5534084bbc9e30821e5f1312199a3b5540b85d35..6b61130173d5f7d456d0f4ff90099ac13e9794a8 100644 (file)
@@ -51,6 +51,10 @@ export class CargoWatchProvider {
             // Excape the double quote string:
             args += ' ' + Server.config.cargoWatchOptions.checkArguments;
         }
+        // Windows handles arguments differently than the unix-likes, so we need to wrap the args in double quotes
+        if (process.platform == "win32") {
+            args = '"' + args + '"';
+        }
 
         // Start the cargo watch with json message
         this.cargoProcess = child_process.spawn(