@cestoliv/wt 0.2.0 → 0.2.1

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/cli.js CHANGED
@@ -3,8 +3,8 @@
3
3
  // src/cli.ts
4
4
  import { Command } from "commander";
5
5
  var program = new Command();
6
- program.name("wt").description("Git worktree manager").version("0.2.0").action(async () => {
7
- const { runList } = await import("./list-7UDMSJOS.js");
6
+ program.name("wt").description("Git worktree manager").version("0.2.1").action(async () => {
7
+ const { runList } = await import("./list-5TXRTSIW.js");
8
8
  await runList();
9
9
  });
10
10
  program.command("create [branch]").description("Create a new worktree").action(async (branch) => {
@@ -66,6 +66,23 @@ async function runList(options = {}) {
66
66
  return true;
67
67
  } catch (err) {
68
68
  const msg = String(err);
69
+ if (msg.includes("cannot be moved or removed")) {
70
+ clack.log.warn(
71
+ "Worktree contains git submodules, which prevent standard removal."
72
+ );
73
+ const force = await clack.confirm({
74
+ message: `Force delete ${pc.bold(item.branch)}? The worktree directory will be removed directly.`
75
+ });
76
+ if (clack.isCancel(force) || !force) return false;
77
+ try {
78
+ removeWorktree(item.repoRoot, item.path, true);
79
+ console.log(pc.green(`\u2713 Force-removed ${item.branch}`));
80
+ return true;
81
+ } catch (err2) {
82
+ console.error(pc.red(`\u2717 Failed to force-remove: ${String(err2)}`));
83
+ return false;
84
+ }
85
+ }
69
86
  if (msg.includes("modified or untracked files")) {
70
87
  const dirty = listWorktreeDirtyFiles(item.path);
71
88
  if (dirty.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cestoliv/wt",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Fast, interactive TUI to browse, create, open, and delete git worktrees across repos.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,6 +44,6 @@
44
44
  "tsup": "^8.0.0",
45
45
  "tsx": "^4.19.0",
46
46
  "typescript": "^5.0.0",
47
- "vitest": "^3.0.0"
47
+ "vitest": "^4.1.0"
48
48
  }
49
49
  }