@buildinternet/releases-lib 0.40.1 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/config.ts +30 -0
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -17,3 +17,33 @@ export function getLogsDir(): string {
|
|
|
17
17
|
mkdirSync(dir, { recursive: true });
|
|
18
18
|
return dir;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Maintenance workspace root (`<dataDir>/work`). Home of the agent-driven
|
|
23
|
+
* admin maintenance trail — `tasks/`, `runs/`, `reports/`. See
|
|
24
|
+
* `docs/architecture/maintenance-workspace.md` in the monorepo.
|
|
25
|
+
*/
|
|
26
|
+
export function getWorkDir(): string {
|
|
27
|
+
const dir = join(getDataDir(), "work");
|
|
28
|
+
mkdirSync(dir, { recursive: true });
|
|
29
|
+
return dir;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Per-run evidence dir (`<dataDir>/work/runs`) — session traces land here. */
|
|
33
|
+
export function getRunsDir(): string {
|
|
34
|
+
const dir = join(getWorkDir(), "runs");
|
|
35
|
+
mkdirSync(dir, { recursive: true });
|
|
36
|
+
return dir;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Expand a leading `~` / `~/` to the home dir. A shell `export FOO=~/x`
|
|
41
|
+
* expands the tilde at assignment time, but a quoted `FOO="~/x"` does not —
|
|
42
|
+
* so workspace paths read from env (e.g. `RELEASES_RUN_DIR`) may arrive
|
|
43
|
+
* tilde-prefixed. Only the leading `~` is handled; `~user` is left intact.
|
|
44
|
+
*/
|
|
45
|
+
export function expandHome(p: string): string {
|
|
46
|
+
if (p === "~") return homedir();
|
|
47
|
+
if (p.startsWith("~/")) return join(homedir(), p.slice(2));
|
|
48
|
+
return p;
|
|
49
|
+
}
|