We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 716bee8 commit b37ac29Copy full SHA for b37ac29
demo/ctx/src/state.ts
@@ -1,4 +1,5 @@
1
import fs from "fs";
2
+import os from "os";
3
import path from "path";
4
import { createHash } from "crypto";
5
@@ -8,7 +9,7 @@ export type FileEntry = [path: string, hash: string];
8
9
let _stateDir: string | undefined;
10
function getStateDir(): string {
11
if (!_stateDir) {
- _stateDir = path.join(process.env.HOME!, ".ctx", "state");
12
+ _stateDir = path.join(os.homedir(), ".ctx", "state");
13
fs.mkdirSync(_stateDir, { recursive: true });
14
}
15
return _stateDir;
0 commit comments