Skip to content

Commit 4c7d3b6

Browse files
committed
use relative path for local streaming file.
1 parent 1f0622b commit 4c7d3b6

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ backend/dist/
88
frontend/demo-recordings/
99
frontend/test-results/
1010
frontend/playwright-report/
11-
frontend/playwright/.cache/
11+
frontend/playwright/.cache/
12+
13+
backend/.streaming/

backend/deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"tasks": {
1212
"generate-version": "node scripts/generate-version.js",
1313
"copy-frontend": "node scripts/copy-frontend.js",
14-
"dev": "deno task generate-version && dotenvx run --env-file=../.env -- deno run --allow-net --allow-run --allow-read --allow-env --watch cli/deno.ts --debug",
15-
"build": "deno task generate-version && deno task copy-frontend && deno compile --allow-net --allow-run --allow-read --allow-env --include ./dist/static --output ../dist/claude-code-webui cli/deno.ts",
14+
"dev": "deno task generate-version && dotenvx run --env-file=../.env -- deno run --allow-net --allow-run --allow-read --allow-write=./.streaming --allow-env --watch cli/deno.ts --debug",
15+
"build": "deno task generate-version && deno task copy-frontend && deno compile --allow-net --allow-run --allow-read --allow-write=./.streaming --allow-env --include ./dist/static --output ../dist/claude-code-webui cli/deno.ts",
1616
"format": "deno fmt",
1717
"lint": "deno lint",
1818
"check": "deno check",

backend/streaming/streamingFileManager.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Handles writing, reading, and cleaning up streaming response files
44
*/
55

6+
import process from "node:process";
67
import type { Runtime } from "../runtime/types.ts";
78
import type { StreamResponse } from "../../shared/types.ts";
89
import { RequestStatus } from "../../shared/types.ts";
@@ -40,17 +41,21 @@ export function stopCleanupInterval() {
4041
}
4142

4243
/**
43-
* Get the streaming directory path for a project
44+
* Get the streaming directory path for a project relative to current working directory
4445
*/
4546
export function getStreamingDir(
4647
encodedProjectName: string,
4748
runtime: Runtime,
4849
): string {
49-
const homeDir = runtime.getEnv("HOME");
50-
if (!homeDir) {
51-
throw new Error("HOME environment variable not found");
50+
// Check if there's a custom streaming base directory set in environment
51+
const customDir = runtime.getEnv("CLAUDE_STREAMING_DIR");
52+
if (customDir) {
53+
return `${customDir}/${encodedProjectName}`;
5254
}
53-
return `${homeDir}/.claude/projects/${encodedProjectName}/streaming`;
55+
56+
// Otherwise, use current working directory
57+
const cwd = process.cwd();
58+
return `${cwd}/.streaming/${encodedProjectName}`;
5459
}
5560

5661
/**

0 commit comments

Comments
 (0)