authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-17 21:33:22-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-18 00:59:06-08:00
log4d886b99f5f786ee407d8d38d77c0e9d1c7548da
tree94242deff5b3034c9aeb0caca626343c2c0452d6
parent4e791759cfecaa74319959fe800e0a34c680c442

Fix Windows percent escaping in script env injection

Co-authored-by: codex <codex@users.noreply.github.com>

2 files changed, 2 insertions(+), 2 deletions(-)

apps/web/src/projectScripts.test.ts+1-1
...@@ -40,7 +40,7 @@ describe("projectScripts helpers", () => {...@@ -40,7 +40,7 @@ describe("projectScripts helpers", () => {
40 { T3CODE_PROJECT_ROOT: '%USERPROFILE%^"repo"' },40 { T3CODE_PROJECT_ROOT: '%USERPROFILE%^"repo"' },
41 "Win32",41 "Win32",
42 );42 );
43 expect(command).toBe('set "T3CODE_PROJECT_ROOT=%%USERPROFILE%%^^""repo""" && bun install');43 expect(command).toBe('set "T3CODE_PROJECT_ROOT=^%USERPROFILE^%^^""repo""" && bun install');
44 });44 });
4545
46 it("resolves primary and setup scripts", () => {46 it("resolves primary and setup scripts", () => {
apps/web/src/projectScripts.ts+1-1
...@@ -57,7 +57,7 @@ function shellEscapePosix(value: string): string {...@@ -57,7 +57,7 @@ function shellEscapePosix(value: string): string {
57}57}
5858
59function shellEscapeWindowsSetValue(value: string): string {59function shellEscapeWindowsSetValue(value: string): string {
60 return value.replace(/\^/g, "^^").replace(/%/g, "%%").replace(/"/g, '""');60 return value.replace(/\^/g, "^^").replace(/%/g, "^%").replace(/"/g, '""');
61}61}
6262
63export function injectEnvIntoShellCommand(63export function injectEnvIntoShellCommand(