@darkrymit/crunes-cli 0.8.4 → 0.9.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/dist/chunks/{add-CBHWFGCA.js → add-IT3IHBPO.js} +2 -2
- package/dist/chunks/{apply-YC6JEPUN.js → apply-YY7MIM64.js} +13 -12
- package/dist/chunks/{benchmark-BJEAAFWG.js → benchmark-BQNMULOO.js} +17 -14
- package/dist/chunks/{browse-JZFU52ET.js → browse-PHMBDREQ.js} +2 -2
- package/dist/chunks/{chunk-6MRZXASS.js → chunk-2Q3KLBE6.js} +16 -0
- package/dist/chunks/{chunk-2PBPDTRD.js → chunk-34F4ZURL.js} +40 -37
- package/dist/chunks/{chunk-ZJDKCC2Y.js → chunk-4GJMCFR6.js} +6 -3
- package/dist/chunks/chunk-CY6C6ADU.js +2787 -0
- package/dist/chunks/{chunk-J3GZ3DXD.js → chunk-GVMT55GH.js} +3 -2
- package/dist/chunks/{chunk-JOAL437H.js → chunk-I6MHDUCW.js} +16 -1
- package/dist/chunks/{chunk-6XLT25GS.js → chunk-MIKWIFYR.js} +47 -0
- package/dist/chunks/chunk-MRNZFUXZ.js +70 -0
- package/dist/chunks/{chunk-NAEVMRNA.js → chunk-PBGUKXT6.js} +2940 -1847
- package/dist/chunks/chunk-QYRF3R35.js +154 -0
- package/dist/chunks/{chunk-DZJRYFOP.js → chunk-SNC7AOT7.js} +78 -12
- package/dist/chunks/{chunk-63H5VXZY.js → chunk-UEUUOAJY.js} +4 -1
- package/dist/chunks/{chunk-65J65MAP.js → chunk-VST6HAB6.js} +16 -2
- package/dist/chunks/{chunk-NDEYEYSU.js → chunk-WJII3LZK.js} +4 -3
- package/dist/chunks/chunk-X7PZN73N.js +44 -0
- package/dist/chunks/{chunk-NYLRTAAA.js → chunk-YVN3VDRE.js} +1 -1
- package/dist/chunks/{chunk-JU6FKUBY.js → chunk-YXCHIMLW.js} +995 -3097
- package/dist/chunks/{clear-YBDIPEEH.js → clear-AT7HNUV4.js} +2 -2
- package/dist/chunks/{create-GPDE2YKL.js → create-ET6DT5ZE.js} +22 -18
- package/dist/chunks/{create-OZACMPEU.js → create-LM7U3CJS.js} +28 -20
- package/dist/chunks/{create-ZFFV3Z2P.js → create-TLPM7HJE.js} +5 -5
- package/dist/chunks/{delete-LNOYM5KG.js → delete-5R3WBLVD.js} +5 -5
- package/dist/chunks/{delete-E4TEBRPX.js → delete-GKYA2W5Z.js} +4 -2
- package/dist/chunks/{delete-C4UJ7X5K.js → delete-U4STA2QZ.js} +5 -5
- package/dist/chunks/disable-TNTEIAKO.js +39 -0
- package/dist/chunks/doctor-VXAQYMTR.js +101 -0
- package/dist/chunks/enable-GUQCB4CU.js +31 -0
- package/dist/chunks/{globals-H2WF344Y.js → globals-SNQFCHMP.js} +1 -1
- package/dist/chunks/{init-HU5OMHEH.js → init-PJSCFOC6.js} +14 -8
- package/dist/chunks/{install-RRLUOYFO.js → install-4YP7FALO.js} +18 -16
- package/dist/chunks/{intro-4CICBP2J.js → intro-SA7MWV3Z.js} +113 -43
- package/dist/chunks/{kill-2UG7PHUV.js → kill-TX3PC73P.js} +2 -1
- package/dist/chunks/list-7R6NASFI.js +92 -0
- package/dist/chunks/{list-4X3JFQGS.js → list-EHREZR6M.js} +2 -1
- package/dist/chunks/{list-U7PAYNAH.js → list-LC6HB3H3.js} +2 -2
- package/dist/chunks/{list-FLAYJQKN.js → list-OMMZAQ23.js} +2 -2
- package/dist/chunks/{list-7VHJIUDX.js → list-U4EMHQZT.js} +2 -2
- package/dist/chunks/{list-PTAWQYWG.js → list-V7VVD5AG.js} +2 -1
- package/dist/chunks/{list-A5WVDBWF.js → list-VA73WPK6.js} +2 -2
- package/dist/chunks/{list-CK5X2YN3.js → list-WKNPZZOV.js} +5 -4
- package/dist/chunks/{output-RJ6JSNY7.js → output-QN5CVJ62.js} +4 -1
- package/dist/chunks/{query-AW7WYILM.js → query-2US3CPYT.js} +2 -2
- package/dist/chunks/{registry-3QIL5SVL.js → registry-K5DV5NAK.js} +4 -2
- package/dist/chunks/{remove-QUH2D3S5.js → remove-BCFTF23J.js} +2 -2
- package/dist/chunks/{repl-STBZC4P2.js → repl-2YWTHUWT.js} +4 -0
- package/dist/chunks/{repl-VGC5FUJG.js → repl-ZB3DIJ4K.js} +84 -26
- package/dist/chunks/resolver-QIYYFIDX.js +34 -0
- package/dist/chunks/run-22B65ZWZ.js +29 -0
- package/dist/chunks/rune-SYK4N642.js +425 -0
- package/dist/chunks/{search-MSSDGJTF.js → search-B7IM7JRJ.js} +2 -2
- package/dist/chunks/shell-explain-QLITLHW7.js +74 -0
- package/dist/chunks/{uninstall-55YTHZRH.js → uninstall-4WR5IHLC.js} +15 -11
- package/dist/chunks/{unset-YASSMSE5.js → unset-P6IUF7SS.js} +2 -2
- package/dist/chunks/{update-G6XO4RIM.js → update-ACLDK6E6.js} +19 -18
- package/dist/chunks/{update-EWWDROKW.js → update-WXT7CHYA.js} +2 -2
- package/dist/chunks/{utils-XOWJQWNR.js → utils-B2QULX5J.js} +8 -4
- package/dist/chunks/{version-PW7MHDFH.js → version-EULYWNXN.js} +3 -2
- package/dist/cli.js +93 -71
- package/package.json +2 -1
- package/dist/chunks/chunk-ASZKAC24.js +0 -103
- package/dist/chunks/chunk-H3BVJCIL.js +0 -105
- package/dist/chunks/disable-TMG2K3BF.js +0 -47
- package/dist/chunks/doctor-N43QEMAH.js +0 -53
- package/dist/chunks/enable-327OMBPC.js +0 -47
- package/dist/chunks/list-WH7KESMV.js +0 -111
- package/dist/chunks/resolver-QMIY33FM.js +0 -26
- package/dist/chunks/run-T33CMCFZ.js +0 -26
- package/dist/chunks/rune-UBRVWG5A.js +0 -139
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadConfig
|
|
3
|
+
} from "./chunk-QYRF3R35.js";
|
|
4
|
+
import {
|
|
5
|
+
output
|
|
6
|
+
} from "./chunk-MIKWIFYR.js";
|
|
1
7
|
import {
|
|
2
8
|
fe,
|
|
3
9
|
ge,
|
|
4
10
|
le,
|
|
5
11
|
ye
|
|
6
12
|
} from "./chunk-CGZL5SSH.js";
|
|
7
|
-
import {
|
|
8
|
-
loadConfig
|
|
9
|
-
} from "./chunk-H3BVJCIL.js";
|
|
10
|
-
import {
|
|
11
|
-
output
|
|
12
|
-
} from "./chunk-6XLT25GS.js";
|
|
13
13
|
import "./chunk-WCODTMDN.js";
|
|
14
14
|
import {
|
|
15
15
|
loadRegistry,
|
|
16
16
|
resolvePluginKey
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-VST6HAB6.js";
|
|
18
|
+
import "./chunk-2Q3KLBE6.js";
|
|
19
19
|
import {
|
|
20
20
|
loadPluginJson
|
|
21
21
|
} from "./chunk-G3U4V32O.js";
|
|
@@ -61,12 +61,13 @@ async function resolveTemplate(sourceName, templateName, projectRoot) {
|
|
|
61
61
|
}
|
|
62
62
|
const templateMeta = (pluginJson.templates ?? {})[templateName];
|
|
63
63
|
if (templateMeta) {
|
|
64
|
-
matches.push({ pluginName, pluginEntry, pluginJson, templateMeta });
|
|
64
|
+
matches.push({ pluginKey, pluginName, pluginEntry, pluginJson, templateMeta });
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (matches.length > 1) {
|
|
68
|
-
const sources = matches.map((m) => m.
|
|
69
|
-
|
|
68
|
+
const sources = matches.map((m) => m.pluginKey).join(", ");
|
|
69
|
+
const options = matches.map((m) => `${m.pluginKey}:${templateName}`).join(" or ");
|
|
70
|
+
output.error(`"${templateName}" matches templates in multiple sources: ${sources}. Use ${options}.`);
|
|
70
71
|
process.exit(1);
|
|
71
72
|
}
|
|
72
73
|
if (matches.length === 1) {
|
|
@@ -116,7 +117,7 @@ async function handler({
|
|
|
116
117
|
let templateMeta = {};
|
|
117
118
|
if (resolved.type === "local") {
|
|
118
119
|
const localPath = typeof resolved.entry === "string" ? resolved.entry : resolved.entry.path;
|
|
119
|
-
await fs.copyFile(path.
|
|
120
|
+
await fs.copyFile(path.resolve(projectRoot, localPath), runeAbsPath);
|
|
120
121
|
templateMeta = typeof resolved.entry === "string" ? {} : resolved.entry;
|
|
121
122
|
} else if (resolved.type === "shortcut") {
|
|
122
123
|
const pluginRef = resolved.entry.plugin;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
|
+
joinBracketTokens,
|
|
2
3
|
parseBracketKey
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
loadConfig
|
|
6
|
-
} from "./chunk-H3BVJCIL.js";
|
|
4
|
+
} from "./chunk-SNC7AOT7.js";
|
|
7
5
|
import {
|
|
8
6
|
runRune
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-YXCHIMLW.js";
|
|
8
|
+
import "./chunk-UEUUOAJY.js";
|
|
9
|
+
import "./chunk-4GJMCFR6.js";
|
|
10
|
+
import "./chunk-CY6C6ADU.js";
|
|
11
|
+
import "./chunk-GVMT55GH.js";
|
|
12
|
+
import "./chunk-WJII3LZK.js";
|
|
13
13
|
import "./chunk-G4ZAUHHA.js";
|
|
14
|
-
import
|
|
15
|
-
|
|
14
|
+
import {
|
|
15
|
+
loadConfig
|
|
16
|
+
} from "./chunk-QYRF3R35.js";
|
|
16
17
|
import {
|
|
17
18
|
output
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MIKWIFYR.js";
|
|
20
|
+
import "./chunk-CGZL5SSH.js";
|
|
19
21
|
import {
|
|
20
22
|
source_default
|
|
21
23
|
} from "./chunk-WCODTMDN.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-VST6HAB6.js";
|
|
25
|
+
import "./chunk-2Q3KLBE6.js";
|
|
24
26
|
import "./chunk-G3U4V32O.js";
|
|
25
27
|
import {
|
|
26
28
|
init_require_shim
|
|
@@ -98,7 +100,8 @@ function parseBenchArgs(argv) {
|
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
rawSegments.push(current);
|
|
101
|
-
const segments = rawSegments.map((
|
|
103
|
+
const segments = rawSegments.map((rawSeg) => {
|
|
104
|
+
const seg = joinBracketTokens(rawSeg);
|
|
102
105
|
const { key, bracketArgs } = parseBracketKey(seg[0] ?? "");
|
|
103
106
|
let runs = globalRuns;
|
|
104
107
|
let warmup = globalWarmup;
|
|
@@ -5,11 +5,25 @@ import {
|
|
|
5
5
|
// src/store/index.js
|
|
6
6
|
init_require_shim();
|
|
7
7
|
import fs from "node:fs/promises";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
8
9
|
import os from "node:os";
|
|
9
10
|
import path from "node:path";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
10
12
|
function getStorePath() {
|
|
11
13
|
return process.env.CRUNES_STORE ?? path.join(os.homedir(), ".crunes");
|
|
12
14
|
}
|
|
15
|
+
function shortHash(str) {
|
|
16
|
+
return createHash("sha1").update(str).digest("hex").slice(0, 8);
|
|
17
|
+
}
|
|
18
|
+
function isRootless(projectDir) {
|
|
19
|
+
return !existsSync(path.join(projectDir, ".crunes", "config.json"));
|
|
20
|
+
}
|
|
21
|
+
function getRootlessBase(projectDir) {
|
|
22
|
+
return path.join(getStorePath(), "rootless", shortHash(projectDir));
|
|
23
|
+
}
|
|
24
|
+
function getLocalBase(projectDir) {
|
|
25
|
+
return isRootless(projectDir) ? getRootlessBase(projectDir) : path.join(projectDir, ".crunes");
|
|
26
|
+
}
|
|
13
27
|
function getProjectsJsonPath() {
|
|
14
28
|
return path.join(getStorePath(), "projects.json");
|
|
15
29
|
}
|
|
@@ -49,6 +63,8 @@ async function ensureStoreDirs() {
|
|
|
49
63
|
|
|
50
64
|
export {
|
|
51
65
|
getStorePath,
|
|
66
|
+
isRootless,
|
|
67
|
+
getLocalBase,
|
|
52
68
|
getProjectsJsonPath,
|
|
53
69
|
getPluginsJsonPath,
|
|
54
70
|
getPluginCacheDir,
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
getConfigPath,
|
|
3
|
+
readRawConfig,
|
|
4
|
+
setPluginEnabled,
|
|
5
|
+
writeRawConfig
|
|
6
|
+
} from "./chunk-X7PZN73N.js";
|
|
7
|
+
import {
|
|
8
|
+
coercePlugins
|
|
9
|
+
} from "./chunk-QYRF3R35.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-MIKWIFYR.js";
|
|
13
|
+
import {
|
|
3
14
|
R,
|
|
4
15
|
le
|
|
5
16
|
} from "./chunk-CGZL5SSH.js";
|
|
@@ -7,12 +18,12 @@ import {
|
|
|
7
18
|
loadRegistry,
|
|
8
19
|
registerPlugin,
|
|
9
20
|
removePlugin
|
|
10
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VST6HAB6.js";
|
|
11
22
|
import {
|
|
12
23
|
ensureStoreDirs,
|
|
13
24
|
getPluginCacheDir,
|
|
14
25
|
getPnpmStorePath
|
|
15
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-2Q3KLBE6.js";
|
|
16
27
|
import {
|
|
17
28
|
loadPluginJson
|
|
18
29
|
} from "./chunk-G3U4V32O.js";
|
|
@@ -143,7 +154,7 @@ function formatConsentScreen(pluginName, pluginJson) {
|
|
|
143
154
|
async function promptConsent(pluginName, pluginJson, { yes = false } = {}) {
|
|
144
155
|
const isYes = yes || !process.stdout.isTTY;
|
|
145
156
|
if (isYes) return true;
|
|
146
|
-
|
|
157
|
+
output.note(formatConsentScreen(pluginName, pluginJson), "Permissions requested");
|
|
147
158
|
const answer = await le({ message: "Allow these permissions?" });
|
|
148
159
|
if (R(answer)) return false;
|
|
149
160
|
return answer === true;
|
|
@@ -170,7 +181,7 @@ async function promptReConsent(pluginName, diff, { yes = false } = {}) {
|
|
|
170
181
|
}
|
|
171
182
|
lines.push("");
|
|
172
183
|
}
|
|
173
|
-
|
|
184
|
+
output.note(lines.join("\n"), "New permissions");
|
|
174
185
|
const answer = await le({ message: "Allow these new permissions?" });
|
|
175
186
|
if (R(answer)) return false;
|
|
176
187
|
return answer === true;
|
|
@@ -228,7 +239,7 @@ async function downloadNpm(packageName, destDir) {
|
|
|
228
239
|
}
|
|
229
240
|
}
|
|
230
241
|
async function installPlugin(source, projectDir, provenance = {}, options = {}) {
|
|
231
|
-
const { yes = false } = options;
|
|
242
|
+
const { yes = false, global = false } = options;
|
|
232
243
|
if (!provenance.marketplaceName) {
|
|
233
244
|
throw new Error("Direct installs are not allowed. Use: crunes plugin install <marketplace>@<plugin>");
|
|
234
245
|
}
|
|
@@ -255,7 +266,7 @@ async function installPlugin(source, projectDir, provenance = {}, options = {})
|
|
|
255
266
|
const registry = await loadRegistry();
|
|
256
267
|
const existing = registry.plugins?.[pluginKey];
|
|
257
268
|
if (existing) {
|
|
258
|
-
return await updatePlugin(pluginKey, stagingDir, pluginJson, projectDir, type === "local", provenance, { yes });
|
|
269
|
+
return await updatePlugin(pluginKey, stagingDir, pluginJson, projectDir, type === "local", provenance, { yes, global });
|
|
259
270
|
}
|
|
260
271
|
const isLocal = type === "local";
|
|
261
272
|
const cacheDir = getPluginCacheDir(name, version, provenance.marketplaceName);
|
|
@@ -275,7 +286,7 @@ async function installPlugin(source, projectDir, provenance = {}, options = {})
|
|
|
275
286
|
consentedPermissions[key] = collectAllowFromRune(rune);
|
|
276
287
|
}
|
|
277
288
|
await registerPlugin({ name, version, path: isLocal ? stagingDir : cacheDir, cacheDir, local: isLocal, consentedPermissions, ...provenance });
|
|
278
|
-
await
|
|
289
|
+
await setEnabled(projectDir, pluginKey, true, global);
|
|
279
290
|
return { installed: true, name: pluginKey, version };
|
|
280
291
|
} finally {
|
|
281
292
|
if (type !== "local") {
|
|
@@ -285,7 +296,7 @@ async function installPlugin(source, projectDir, provenance = {}, options = {})
|
|
|
285
296
|
}
|
|
286
297
|
}
|
|
287
298
|
async function updatePlugin(pluginKey, newPluginDir, newPluginJson, projectDir, isLocal, provenance = {}, options = {}) {
|
|
288
|
-
const { yes = false } = options;
|
|
299
|
+
const { yes = false, global = false } = options;
|
|
289
300
|
const registry = await loadRegistry();
|
|
290
301
|
const existing = registry.plugins[pluginKey];
|
|
291
302
|
if (!existing) throw new Error(`Plugin "${pluginKey}" is not installed.`);
|
|
@@ -311,26 +322,31 @@ async function updatePlugin(pluginKey, newPluginDir, newPluginJson, projectDir,
|
|
|
311
322
|
consentedPermissions[key] = collectAllowFromRune(rune);
|
|
312
323
|
}
|
|
313
324
|
await registerPlugin({ name, version, path: isLocal ? newPluginDir : cacheDir, cacheDir, local: isLocal, consentedPermissions, ...provenance });
|
|
314
|
-
await
|
|
325
|
+
await setEnabled(projectDir, pluginKey, true, global);
|
|
315
326
|
return { installed: true, name: pluginKey, version, updated: true };
|
|
316
327
|
}
|
|
317
|
-
async function
|
|
318
|
-
if (!projectDir) return;
|
|
319
|
-
const configPath = path2.join(projectDir, ".crunes", "config.json");
|
|
328
|
+
async function setEnabled(projectDir, pluginKey, enabled, global) {
|
|
329
|
+
if (!projectDir && !global) return;
|
|
320
330
|
try {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
await setPluginEnabled(getConfigPath({ configRoot: projectDir, global }), pluginKey, enabled);
|
|
332
|
+
} catch {
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
async function removeEnabled(projectDir, pluginKey, global) {
|
|
336
|
+
if (!projectDir && !global) return;
|
|
337
|
+
try {
|
|
338
|
+
const configPath = getConfigPath({ configRoot: projectDir, global });
|
|
339
|
+
const config = readRawConfig(configPath);
|
|
340
|
+
if (!config) return;
|
|
341
|
+
const plugins = coercePlugins(config.plugins);
|
|
342
|
+
if (!(pluginKey in plugins)) return;
|
|
343
|
+
delete plugins[pluginKey];
|
|
344
|
+
config.plugins = plugins;
|
|
345
|
+
await writeRawConfig(configPath, config);
|
|
330
346
|
} catch {
|
|
331
347
|
}
|
|
332
348
|
}
|
|
333
|
-
async function uninstallPlugin(pluginKey, projectDir) {
|
|
349
|
+
async function uninstallPlugin(pluginKey, projectDir, { global = false } = {}) {
|
|
334
350
|
const registry = await loadRegistry();
|
|
335
351
|
const entry = registry.plugins?.[pluginKey];
|
|
336
352
|
if (!entry) throw new Error(`Plugin "${pluginKey}" is not installed.`);
|
|
@@ -347,20 +363,7 @@ async function uninstallPlugin(pluginKey, projectDir) {
|
|
|
347
363
|
} catch {
|
|
348
364
|
}
|
|
349
365
|
await removePlugin(pluginKey);
|
|
350
|
-
await
|
|
351
|
-
}
|
|
352
|
-
async function removePluginFromProjectConfig(projectDir, pluginName) {
|
|
353
|
-
if (!projectDir) return;
|
|
354
|
-
const configPath = path2.join(projectDir, ".crunes", "config.json");
|
|
355
|
-
try {
|
|
356
|
-
const raw = await fs2.readFile(configPath, "utf8");
|
|
357
|
-
const config = JSON.parse(raw);
|
|
358
|
-
config.plugins = (config.plugins ?? []).filter((p) => p !== pluginName);
|
|
359
|
-
const tmp = configPath + "." + Date.now() + Math.random().toString(36).slice(2) + ".tmp";
|
|
360
|
-
await fs2.writeFile(tmp, JSON.stringify(config, null, 2), "utf8");
|
|
361
|
-
await fs2.rename(tmp, configPath);
|
|
362
|
-
} catch {
|
|
363
|
-
}
|
|
366
|
+
await removeEnabled(projectDir, pluginKey, global);
|
|
364
367
|
}
|
|
365
368
|
|
|
366
369
|
export {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getLocalBase
|
|
3
|
+
} from "./chunk-2Q3KLBE6.js";
|
|
1
4
|
import {
|
|
2
5
|
init_require_shim
|
|
3
6
|
} from "./chunk-TPK5AGRA.js";
|
|
@@ -8,7 +11,7 @@ import { readFile, writeFile, mkdir, readdir, rm } from "node:fs/promises";
|
|
|
8
11
|
import { join } from "node:path";
|
|
9
12
|
import { randomUUID } from "node:crypto";
|
|
10
13
|
function jobDir(projectDir, id) {
|
|
11
|
-
return join(projectDir, "
|
|
14
|
+
return join(getLocalBase(projectDir), "jobs", id);
|
|
12
15
|
}
|
|
13
16
|
function jobStdoutPath(projectDir, id) {
|
|
14
17
|
return join(jobDir(projectDir, id), "stdout.log");
|
|
@@ -42,7 +45,7 @@ async function getJob(projectDir, id) {
|
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
async function listJobs(projectDir) {
|
|
45
|
-
const base = join(projectDir, "
|
|
48
|
+
const base = join(getLocalBase(projectDir), "jobs");
|
|
46
49
|
let entries;
|
|
47
50
|
try {
|
|
48
51
|
entries = await readdir(base, { withFileTypes: true });
|
|
@@ -58,7 +61,7 @@ async function deleteJob(projectDir, id) {
|
|
|
58
61
|
await rm(jobDir(projectDir, id), { recursive: true, force: true });
|
|
59
62
|
}
|
|
60
63
|
async function cleanJobs(projectDir) {
|
|
61
|
-
const base = join(projectDir, "
|
|
64
|
+
const base = join(getLocalBase(projectDir), "jobs");
|
|
62
65
|
let entries;
|
|
63
66
|
try {
|
|
64
67
|
entries = await readdir(base, { withFileTypes: true });
|