taskplane 0.1.3 → 0.1.4
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/taskplane.mjs +41 -0
- package/package.json +1 -1
package/bin/taskplane.mjs
CHANGED
|
@@ -255,6 +255,42 @@ monitoring:
|
|
|
255
255
|
// COMMANDS
|
|
256
256
|
// ═════════════════════════════════════════════════════════════════════════════
|
|
257
257
|
|
|
258
|
+
/** Auto-commit task files to git so they're available in orchestrator worktrees. */
|
|
259
|
+
async function autoCommitTaskFiles(projectRoot, tasksRoot) {
|
|
260
|
+
// Check if we're in a git repo
|
|
261
|
+
try {
|
|
262
|
+
execSync("git rev-parse --is-inside-work-tree", { cwd: projectRoot, stdio: "pipe" });
|
|
263
|
+
} catch {
|
|
264
|
+
// Not a git repo — skip silently
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Stage the tasks directory (not .pi/ — that's gitignored)
|
|
269
|
+
const tasksDir = path.join(projectRoot, tasksRoot);
|
|
270
|
+
if (!fs.existsSync(tasksDir)) return;
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
// Check if there's anything new to commit
|
|
274
|
+
execSync(`git add "${tasksRoot}"`, { cwd: projectRoot, stdio: "pipe" });
|
|
275
|
+
const status = execSync("git diff --cached --name-only", { cwd: projectRoot, stdio: "pipe" })
|
|
276
|
+
.toString()
|
|
277
|
+
.trim();
|
|
278
|
+
|
|
279
|
+
if (!status) return; // nothing staged
|
|
280
|
+
|
|
281
|
+
execSync('git commit -m "chore: initialize taskplane tasks"', {
|
|
282
|
+
cwd: projectRoot,
|
|
283
|
+
stdio: "pipe",
|
|
284
|
+
});
|
|
285
|
+
console.log(`\n ${c.green}git${c.reset} committed ${tasksRoot}/ to git`);
|
|
286
|
+
console.log(` ${c.dim}(orchestrator worktrees require committed files)${c.reset}`);
|
|
287
|
+
} catch (err) {
|
|
288
|
+
// Git commit failed — warn but don't block init
|
|
289
|
+
console.log(`\n ${WARN} Could not auto-commit task files to git.`);
|
|
290
|
+
console.log(` ${c.dim}Run manually before using /orch: git add ${tasksRoot} && git commit -m "add taskplane tasks"${c.reset}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
258
294
|
// ─── init ───────────────────────────────────────────────────────────────────
|
|
259
295
|
|
|
260
296
|
async function cmdInit(args) {
|
|
@@ -359,6 +395,11 @@ async function cmdInit(args) {
|
|
|
359
395
|
}
|
|
360
396
|
}
|
|
361
397
|
|
|
398
|
+
// Auto-commit task files to git so they're available in worktrees
|
|
399
|
+
if (!dryRun) {
|
|
400
|
+
await autoCommitTaskFiles(projectRoot, vars.tasks_root);
|
|
401
|
+
}
|
|
402
|
+
|
|
362
403
|
// Report
|
|
363
404
|
console.log(`\n${OK} ${c.bold}Taskplane initialized!${c.reset}\n`);
|
|
364
405
|
console.log(`${c.bold}Quick start:${c.reset}`);
|