History

Resolve T3CODE_STATE_DIR paths against repo root

- Resolve `T3CODE_STATE_DIR` override/env values with `path.resolve` - Prevent path breakage when Turbo changes the working directory

Julius Marminge committed 8 months ago

Commit 4fac2d21 parent 58692df1 file · +3 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/dev-runner.mjs+3−2
@@ -154,12 +154,13 @@ export function parseDevRunnerArgs(rawArgs) { · 153 unmodified lines
154154 function resolveStateDir(env, envOverrides) {
155155 const overrideValue = envOverrides?.T3CODE_STATE_DIR?.trim();
156156 if (overrideValue) {
157− return overrideValue;
157+ // Resolve relative paths against cwd (monorepo root) before turbo changes directories
158+ return path.resolve(overrideValue);
158159 }
159160
160161 const envValue = env?.T3CODE_STATE_DIR?.trim();
161162 if (envValue) {
162− return envValue;
163+ return path.resolve(envValue);
163164 }
164165
165166 return DEFAULT_DEV_STATE_DIR;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t