this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix shell quoting on windows machines to avoid upload errors (#976)

authored by

rgembalik and committed by
GitHub
93f4c8a5 b455640a

+17
+5
.changeset/thick-oranges-smoke.md
··· 1 + --- 2 + "@opennextjs/cloudflare": patch 3 + --- 4 + 5 + fix: shell quoting on windows machines to avoid upload errors for routes with `[...path]` segments
+12
packages/cloudflare/src/cli/commands/helpers.ts
··· 83 83 * @returns escaped arg 84 84 */ 85 85 export function quoteShellMeta(arg: string) { 86 + if (process.platform === "win32") { 87 + if (arg.length === 0) { 88 + return '""'; 89 + } 90 + const needsEscaping = /[&|<>^()%!"]/; 91 + const needsQuotes = /\s/.test(arg) || needsEscaping.test(arg); 92 + let escaped = arg.replace(/"/g, '""'); 93 + if (/[&|<>^()%!]/.test(arg)) { 94 + escaped = escaped.replace(/[&|<>^()%!]/g, "^$&"); 95 + } 96 + return needsQuotes ? `"${escaped}"` : escaped; 97 + } 86 98 if (/["\s]/.test(arg) && !/'/.test(arg)) { 87 99 return `'${arg.replace(/(['\\])/g, "\\$1")}'`; 88 100 }