From 5f94bfd5feeab3123659be63d4acdfff6dd24d3f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Feb 2026 21:33:22 -0800 Subject: [PATCH] Fix Windows percent escaping in script env injection Co-authored-by: codex --- apps/web/src/projectScripts.test.ts | 2 +- apps/web/src/projectScripts.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/projectScripts.test.ts b/apps/web/src/projectScripts.test.ts index 3180e793ef..3dad5824ab 100644 --- a/apps/web/src/projectScripts.test.ts +++ b/apps/web/src/projectScripts.test.ts @@ -40,7 +40,7 @@ describe("projectScripts helpers", () => { { T3CODE_PROJECT_ROOT: '%USERPROFILE%^"repo"' }, "Win32", ); - expect(command).toBe('set "T3CODE_PROJECT_ROOT=%%USERPROFILE%%^^""repo""" && bun install'); + expect(command).toBe('set "T3CODE_PROJECT_ROOT=^%USERPROFILE^%^^""repo""" && bun install'); }); it("resolves primary and setup scripts", () => { diff --git a/apps/web/src/projectScripts.ts b/apps/web/src/projectScripts.ts index d093138a66..e7086a2f7a 100644 --- a/apps/web/src/projectScripts.ts +++ b/apps/web/src/projectScripts.ts @@ -57,7 +57,7 @@ function shellEscapePosix(value: string): string { } function shellEscapeWindowsSetValue(value: string): string { - return value.replace(/\^/g, "^^").replace(/%/g, "%%").replace(/"/g, '""'); + return value.replace(/\^/g, "^^").replace(/%/g, "^%").replace(/"/g, '""'); } export function injectEnvIntoShellCommand(