@lsst/pik-plugin-worktree 0.6.2 → 0.6.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/index.js CHANGED
@@ -109,7 +109,7 @@ async function isWorktree(path) {
109
109
  return false;
110
110
  }
111
111
  }
112
- const createCommand = new Command("create").alias("add").description("Create a new worktree").argument("[name]", "Name for the worktree directory").option("-b, --branch <branch>", "Branch to checkout (or create with -n)").option("-n, --new", "Create a new branch").action(async (name, options) => {
112
+ const createCommand = new Command("create").alias("add").description("Create a new worktree").argument("[name]", "Name for the worktree directory").option("-b, --branch <branch>", "Branch to checkout (or create with -n)").option("-n, --new", "Create a new branch").option("-y, --yes", "Skip confirmations (for programmatic use)").action(async (name, options) => {
113
113
  try {
114
114
  const repoRoot = await getRepoRoot();
115
115
  const config = await loadConfig(repoRoot);
@@ -204,7 +204,7 @@ const createCommand = new Command("create").alias("add").description("Create a n
204
204
  }
205
205
  }
206
206
  if (worktreeConfig.postCreate) {
207
- const shouldRun = await confirm({
207
+ const shouldRun = options.yes || await confirm({
208
208
  message: `Run "${worktreeConfig.postCreate}"?`,
209
209
  default: true
210
210
  });
@@ -227,7 +227,7 @@ const createCommand = new Command("create").alias("add").description("Create a n
227
227
  } catch (error) {
228
228
  if (error instanceof Error) {
229
229
  if (error.name === "ExitPromptError") {
230
- return;
230
+ process.exit(0);
231
231
  }
232
232
  console.error(pc.red(error.message));
233
233
  }
@@ -329,7 +329,7 @@ const removeCommand = new Command("remove").alias("rm").description("Remove a wo
329
329
  } catch (error) {
330
330
  if (error instanceof Error) {
331
331
  if (error.name === "ExitPromptError") {
332
- return;
332
+ process.exit(0);
333
333
  }
334
334
  console.error(pc.red(error.message));
335
335
  }
@@ -363,7 +363,7 @@ const worktreePlugin = {
363
363
  });
364
364
  } catch (error) {
365
365
  if (error instanceof Error && error.name === "ExitPromptError") {
366
- return;
366
+ process.exit(0);
367
367
  }
368
368
  throw error;
369
369
  }
@@ -1,4 +1,3 @@
1
1
  import { Command } from 'commander';
2
- import '../types.js';
3
2
  export declare const createCommand: Command;
4
3
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,OAAO,aAAa,CAAC;AAOrB,eAAO,MAAM,aAAa,SAyJtB,CAAC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,OAAO,aAAa,CAAC;AAQrB,eAAO,MAAM,aAAa,SA4JtB,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { PikPlugin } from '@lsst/pik-core';
1
+ import { PikPlugin } from '@lsst/pik-core';
2
2
  export declare const worktreePlugin: PikPlugin;
3
3
  //# sourceMappingURL=plugin.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsst/pik-plugin-worktree",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Git worktree management plugin for pik CLI",
5
5
  "type": "module",
6
6
  "license": "MIT",