Skip to content

Commit b37ac29

Browse files
committed
fix(demo/ctx): use os.homedir() instead of process.env.HOME! in state dir
Made-with: Cursor
1 parent 716bee8 commit b37ac29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

demo/ctx/src/state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from "fs";
2+
import os from "os";
23
import path from "path";
34
import { createHash } from "crypto";
45

@@ -8,7 +9,7 @@ export type FileEntry = [path: string, hash: string];
89
let _stateDir: string | undefined;
910
function getStateDir(): string {
1011
if (!_stateDir) {
11-
_stateDir = path.join(process.env.HOME!, ".ctx", "state");
12+
_stateDir = path.join(os.homedir(), ".ctx", "state");
1213
fs.mkdirSync(_stateDir, { recursive: true });
1314
}
1415
return _stateDir;

0 commit comments

Comments
 (0)