Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/create-cloudflare/src/helpers/shell-quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import shellquote from "shell-quote";
export const quote = shellquote.quote;

export function parse(cmd: string, env?: Record<string, string>): string[] {
// This is a workaround for a bug in shell-quote on Windows
// It was fixed and, because it was a breaking change, then reverted
// in https://github.com/ljharb/shell-quote/commit/144e1c2#diff-e727e4b
// We can remove this once we upgrade to a version that includes the fix
// tracked by https://github.com/ljharb/shell-quote/issues/10
if (process.platform === "win32") {
cmd = cmd.replaceAll("\\", "\\\\");
}

const entries = shellquote.parse(cmd, env);
const argv: string[] = [];

Expand Down
9 changes: 9 additions & 0 deletions packages/wrangler/src/utils/shell-quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import shellquote from "shell-quote";
export const quote = shellquote.quote;

export function parse(cmd: string, env?: Record<string, string>): string[] {
// This is a workaround for a bug in shell-quote on Windows
// It was fixed and, because it was a breaking change, then reverted
// in https://github.com/ljharb/shell-quote/commit/144e1c2#diff-e727e4b
// We can remove this once we upgrade to a version that includes the fix
// tracked by https://github.com/ljharb/shell-quote/issues/10
if (process.platform === "win32") {
cmd = cmd.replaceAll("\\", "\\\\");
}

const entries = shellquote.parse(cmd, env);
const argv: string[] = [];

Expand Down