Skip to content

Commit

Permalink
update the cargo-cp-artifact to make windows nice (#972)
Browse files Browse the repository at this point in the history
update the cargo-cp-artifact to make windows nice

Spawn has slightly different behavior on windows causing the cp command to fail when passing it additional arguments such as `-- type output.txt` (similar to `cat`). This additive change ensures that we are spawning a shell when appropriate on a windows platform. Tested cross platform.

---------

Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
  • Loading branch information
DnOberon and kjvalencik authored Mar 8, 2023
1 parent f00b457 commit 25ff5cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/cargo-cp-artifact/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function run(argv, env) {

const cp = spawn(options.cmd, options.args, {
stdio: ["inherit", "pipe", "inherit"],
shell: process.platform === "win32",
});

const rl = readline.createInterface({ input: cp.stdout });
Expand Down

0 comments on commit 25ff5cc

Please sign in to comment.