agent-worktree 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/install.js +7 -23
  2. package/package.json +5 -5
package/install.js CHANGED
@@ -1,14 +1,10 @@
1
1
  // ============================================================
2
- // Postinstall: Verify Platform Package & Install Shell Wrapper
2
+ // Postinstall: Verify Platform Package & Setup Shell Integration
3
3
  // ============================================================
4
4
 
5
5
  const { execFileSync } = require("child_process");
6
6
  const { join } = require("path");
7
7
 
8
- // ============================================================
9
- // Platform Verification
10
- // ============================================================
11
-
12
8
  const PLATFORMS = {
13
9
  "darwin-arm64": "@nekocode/agent-worktree-darwin-arm64",
14
10
  "darwin-x64": "@nekocode/agent-worktree-darwin-x64",
@@ -25,31 +21,19 @@ if (!pkg) {
25
21
  process.exit(0);
26
22
  }
27
23
 
28
- let binaryPath;
24
+ let pkgDir;
29
25
  try {
30
- const pkgPath = require.resolve(`${pkg}/package.json`);
31
- const exe = process.platform === "win32" ? "wt.exe" : "wt";
32
- binaryPath = join(pkgPath, "..", "bin", exe);
26
+ pkgDir = require.resolve(`${pkg}/package.json`);
33
27
  } catch {
34
28
  console.warn(`[agent-worktree] Warning: Platform package ${pkg} not installed`);
35
29
  console.warn(`[agent-worktree] This may happen if npm failed to install optional dependencies`);
36
30
  process.exit(0);
37
31
  }
38
32
 
39
- // ============================================================
40
- // Shell Wrapper Installation
41
- // ============================================================
42
-
33
+ // Run 'wt setup' to install shell integration
34
+ const binaryPath = join(pkgDir, "..", "bin", "wt");
43
35
  try {
44
- console.log("[agent-worktree] Installing shell integration...");
45
36
  execFileSync(binaryPath, ["setup"], { stdio: "inherit" });
46
- if (process.platform === "win32") {
47
- console.log("[agent-worktree] Shell integration installed. Restart PowerShell to apply changes.");
48
- } else {
49
- console.log("[agent-worktree] Shell integration installed. Restart your shell or run: source ~/.bashrc (or ~/.zshrc)");
50
- }
51
- } catch (err) {
52
- // Non-fatal: user can run `wt setup` manually
53
- console.warn("[agent-worktree] Warning: Could not install shell integration automatically");
54
- console.warn("[agent-worktree] Run 'wt setup' manually to enable shell integration");
37
+ } catch {
38
+ console.warn("[agent-worktree] Auto-setup failed. Run 'wt setup' manually.");
55
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-worktree",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Git worktree workflow tool for AI agents",
5
5
  "keywords": ["cli", "git", "worktree", "ai", "agent"],
6
6
  "license": "MIT",
@@ -24,10 +24,10 @@
24
24
  "postinstall": "node install.js"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@nekocode/agent-worktree-darwin-arm64": "0.5.2",
28
- "@nekocode/agent-worktree-darwin-x64": "0.5.2",
29
- "@nekocode/agent-worktree-linux-x64": "0.5.2",
30
- "@nekocode/agent-worktree-win32-x64": "0.5.2"
27
+ "@nekocode/agent-worktree-darwin-arm64": "0.5.4",
28
+ "@nekocode/agent-worktree-darwin-x64": "0.5.4",
29
+ "@nekocode/agent-worktree-linux-x64": "0.5.4",
30
+ "@nekocode/agent-worktree-win32-x64": "0.5.4"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=14"