File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
create-cloudflare/src/helpers Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ import shellquote from "shell-quote";
33export const quote = shellquote . quote ;
44
55export function parse ( cmd : string , env ?: Record < string , string > ) : string [ ] {
6+ // This is a workaround for a bug in shell-quote on Windows
7+ // It was fixed and, because it was a breaking change, then reverted
8+ // in https://github.com/ljharb/shell-quote/commit/144e1c2#diff-e727e4b
9+ // We can remove this once we upgrade to a version that includes the fix
10+ // tracked by https://github.com/ljharb/shell-quote/issues/10
11+ if ( process . platform === "win32" ) {
12+ cmd = cmd . replaceAll ( "\\" , "\\\\" ) ;
13+ }
14+
615 const entries = shellquote . parse ( cmd , env ) ;
716 const argv : string [ ] = [ ] ;
817
Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ import shellquote from "shell-quote";
33export const quote = shellquote . quote ;
44
55export function parse ( cmd : string , env ?: Record < string , string > ) : string [ ] {
6+ // This is a workaround for a bug in shell-quote on Windows
7+ // It was fixed and, because it was a breaking change, then reverted
8+ // in https://github.com/ljharb/shell-quote/commit/144e1c2#diff-e727e4b
9+ // We can remove this once we upgrade to a version that includes the fix
10+ // tracked by https://github.com/ljharb/shell-quote/issues/10
11+ if ( process . platform === "win32" ) {
12+ cmd = cmd . replaceAll ( "\\" , "\\\\" ) ;
13+ }
14+
615 const entries = shellquote . parse ( cmd , env ) ;
716 const argv : string [ ] = [ ] ;
817
You can’t perform that action at this time.
0 commit comments