@paleo/worktree-env 0.7.2 → 0.7.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/dist/setup-worktree.d.ts +2 -0
- package/dist/setup-worktree.js +12 -3
- package/package.json +1 -1
package/dist/setup-worktree.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export interface PreSetupContext {
|
|
|
86
86
|
export interface SetupContext {
|
|
87
87
|
currentWorktree: string;
|
|
88
88
|
mainWorktree: string;
|
|
89
|
+
/** `true` when finalizing the main worktree. Gate "copy from main" steps with `!isMainWorktree`. */
|
|
90
|
+
isMainWorktree: boolean;
|
|
89
91
|
slot: number;
|
|
90
92
|
branch: string;
|
|
91
93
|
owner?: string;
|
package/dist/setup-worktree.js
CHANGED
|
@@ -66,7 +66,7 @@ export async function runSetupWorktree(config) {
|
|
|
66
66
|
}
|
|
67
67
|
const { slot } = await runSetup(args, ctx, run, config);
|
|
68
68
|
if (isWaitMode(args)) {
|
|
69
|
-
await waitForSlot(slot, config);
|
|
69
|
+
await waitForSlot(slot, config, { printSummary: false });
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
async function runSetup(args, ctx, run, config) {
|
|
@@ -181,6 +181,7 @@ async function runFinalize(args, config) {
|
|
|
181
181
|
const setupContext = {
|
|
182
182
|
currentWorktree: ctx.currentWorktree,
|
|
183
183
|
mainWorktree: ctx.mainWorktree,
|
|
184
|
+
isMainWorktree: ctx.isMainWorktree,
|
|
184
185
|
slot,
|
|
185
186
|
branch: entry.branch,
|
|
186
187
|
owner: entry.owner,
|
|
@@ -257,10 +258,12 @@ function runInfo(args, config) {
|
|
|
257
258
|
printWorktreeInfo(config, resolved.slot, ".", { branch: resolved.branch, owner: resolved.owner });
|
|
258
259
|
}
|
|
259
260
|
async function runWait(args, config) {
|
|
261
|
+
// standalone --wait (no prior setup in this invocation) → print the full summary on success.
|
|
260
262
|
const slot = resolveTargetSlot(args, config);
|
|
261
263
|
await waitForSlot(slot, config);
|
|
262
264
|
}
|
|
263
|
-
async function waitForSlot(slot, config) {
|
|
265
|
+
async function waitForSlot(slot, config, options = {}) {
|
|
266
|
+
const printSummary = options.printSummary ?? true;
|
|
264
267
|
const ctx = detectWorktree();
|
|
265
268
|
const initial = readSlots(ctx.mainWorktree, config.registryDir).slots[String(slot)];
|
|
266
269
|
if (!initial) {
|
|
@@ -277,7 +280,13 @@ async function waitForSlot(slot, config) {
|
|
|
277
280
|
process.exit(1);
|
|
278
281
|
}
|
|
279
282
|
if (entry.status === "ready") {
|
|
280
|
-
|
|
283
|
+
console.log("\n… ready");
|
|
284
|
+
if (printSummary) {
|
|
285
|
+
printWorktreeInfo(config, slot, entry.worktree, {
|
|
286
|
+
branch: entry.branch,
|
|
287
|
+
owner: entry.owner,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
281
290
|
return;
|
|
282
291
|
}
|
|
283
292
|
if (entry.status === "failed") {
|