The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 18:30 UTC
Remove dead code: unused shell env injection functions
Remove injectEnvIntoShellCommand, shellEscapePosix, shellEscapeWindowsSetValue, ENV_KEY_PATTERN, and the now-unused isWindowsPlatform import. These were leftover from an earlier approach where env vars were injected into the shell command string, replaced by passing env directly to terminal.open. Applied via @cursor push command
Cursor Agent committed
Feb 18, 2026 at 08:41 UTC
ac05ddc0f93f5638743dc690b28dbe0c1a391ec8
1 file changed
-34
apps/web/src/projectScripts.ts
-34
@@ -1,10 +1,7 @@
1
import type { ProjectScript } from "@t3tools/contracts";
2
3
-import { isWindowsPlatform } from "./lib/utils";
4
-
3
const SCRIPT_RUN_COMMAND_PATTERN = /^script\.([a-z0-9][a-z0-9-]*)\.run$/;
4
const MAX_SCRIPT_ID_LENGTH = 64;
7
-const ENV_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
5
6
function normalizeScriptId(value: string): string {
7
const cleaned = value
@@ -52,37 +49,6 @@ export function nextProjectScriptId(name: string, existingIds: Iterable<string>)
49
return `${baseId}-${Date.now()}`.slice(0, MAX_SCRIPT_ID_LENGTH);
50
}
51
55
-function shellEscapePosix(value: string): string {
56
- return `'${value.replace(/'/g, `'\\''`)}'`;
57
-}
58
-
59
-function shellEscapeWindowsSetValue(value: string): string {
60
- return value.replace(/\^/g, "^^").replace(/%/g, "^%").replace(/"/g, '""');
61
-}
62
-
63
-function injectEnvIntoShellCommand(
64
- command: string,
65
- env: Record<string, string>,
66
- platform = typeof navigator === "undefined" ? "" : navigator.platform,
67
-): string {
68
- const entries = Object.entries(env).filter(
69
- ([key, value]) => ENV_KEY_PATTERN.test(key) && value.length > 0,
70
- );
71
- if (entries.length === 0) {
72
- return command;
73
- }
74
-
75
- if (isWindowsPlatform(platform)) {
76
- const prefixes = entries.map(
77
- ([key, value]) => `set "${key}=${shellEscapeWindowsSetValue(value)}"`,
78
- );
79
- return `${prefixes.join(" && ")} && ${command}`;
80
- }
81
-
82
- const assignments = entries.map(([key, value]) => `${key}=${shellEscapePosix(value)}`).join(" ");
83
- return `env ${assignments} ${command}`;
84
-}
85
-
52
interface ProjectScriptRuntimeEnvInput {
53
project: {
54
cwd: string;