@roulabs/mx 1.2.1 → 1.2.2
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/bin/mx.js +15 -3
- package/package.json +1 -1
package/bin/mx.js
CHANGED
|
@@ -167,11 +167,23 @@ function initRuntime(target0, templatesDir2) {
|
|
|
167
167
|
removeStaleRuntimeReadme(target);
|
|
168
168
|
return { runtime: target, created };
|
|
169
169
|
}
|
|
170
|
+
function ensureWorkScaffolding(root, workName) {
|
|
171
|
+
const created = [];
|
|
172
|
+
const sessions = path3.join(workDir(root, workName), "sessions");
|
|
173
|
+
if (!exists(sessions)) {
|
|
174
|
+
fs4.mkdirSync(sessions, { recursive: true });
|
|
175
|
+
created.push(sessions);
|
|
176
|
+
}
|
|
177
|
+
return created;
|
|
178
|
+
}
|
|
170
179
|
function updateRuntime(root, templatesDir2) {
|
|
171
|
-
const
|
|
172
|
-
|
|
180
|
+
const updated = [];
|
|
181
|
+
updated.push(stampClaudeMd(root, templatesDir2));
|
|
173
182
|
const ctxIndex = stampContextIndex(root, templatesDir2);
|
|
174
183
|
if (ctxIndex) updated.push(ctxIndex);
|
|
184
|
+
for (const workName of listWorkNames(root)) {
|
|
185
|
+
updated.push(...ensureWorkScaffolding(root, workName));
|
|
186
|
+
}
|
|
175
187
|
removeStaleRuntimeReadme(root);
|
|
176
188
|
return { runtime: root, updated };
|
|
177
189
|
}
|
|
@@ -309,10 +321,10 @@ function workNew(root, name, description = "") {
|
|
|
309
321
|
const dir = workDir(root, name);
|
|
310
322
|
if (exists(dir)) throw new MxError(`work already exists: ${name}`, "EXISTS");
|
|
311
323
|
fs6.mkdirSync(dir, { recursive: true });
|
|
312
|
-
fs6.mkdirSync(path4.join(dir, "sessions"), { recursive: true });
|
|
313
324
|
const work = { name, description, worktrees: [] };
|
|
314
325
|
writeWork(root, work);
|
|
315
326
|
writeJson(workspaceFile(root, name), { folders: [], settings: {} });
|
|
327
|
+
ensureWorkScaffolding(root, name);
|
|
316
328
|
return { ...work, path: dir };
|
|
317
329
|
}
|
|
318
330
|
function listWorksInfo(root, opts = {}) {
|