create-claude-workspace 2.3.25 → 2.3.27

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.
@@ -49,6 +49,9 @@ export function checkPlatformCLI(platform) {
49
49
  * Resolve the full path to a CLI binary.
50
50
  * First tries the bare name (in PATH), then checks known installation directories
51
51
  * for freshly installed tools that aren't in the current process PATH.
52
+ *
53
+ * When found outside PATH, adds the binary's directory to process.env.PATH
54
+ * so all subsequent execFileSync calls in this process can find it.
52
55
  */
53
56
  export function resolveCLIBinary(cli) {
54
57
  // Try bare name first (already in PATH)
@@ -62,18 +65,31 @@ export function resolveCLIBinary(cli) {
62
65
  }
63
66
  // Try known installation paths (winget, scoop, choco, brew, etc.)
64
67
  const candidates = getKnownCLIPaths(cli);
65
- for (const path of candidates) {
68
+ for (const fullPath of candidates) {
66
69
  try {
67
- execFileSync(path, ['--version'], { stdio: 'pipe', timeout: 10_000 });
68
- return path;
70
+ execFileSync(fullPath, ['--version'], { stdio: 'pipe', timeout: 10_000 });
71
+ // Add the directory to PATH so all future exec calls find it
72
+ addToProcessPath(fullPath);
73
+ return fullPath;
69
74
  }
70
75
  catch (err) {
71
- if (err.code !== 'ENOENT')
72
- return path;
76
+ if (err.code !== 'ENOENT') {
77
+ addToProcessPath(fullPath);
78
+ return fullPath;
79
+ }
73
80
  }
74
81
  }
75
82
  return null;
76
83
  }
84
+ /** Add the parent directory of a binary to process.env.PATH */
85
+ function addToProcessPath(binaryPath) {
86
+ const dir = resolve(binaryPath, '..');
87
+ const sep = process.platform === 'win32' ? ';' : ':';
88
+ const currentPath = process.env.PATH ?? '';
89
+ if (!currentPath.split(sep).includes(dir)) {
90
+ process.env.PATH = `${dir}${sep}${currentPath}`;
91
+ }
92
+ }
77
93
  function getKnownCLIPaths(cli) {
78
94
  const paths = [];
79
95
  const isWindows = process.platform === 'win32';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-workspace",
3
- "version": "2.3.25",
3
+ "version": "2.3.27",
4
4
  "author": "",
5
5
  "repository": {
6
6
  "type": "git",