@blueprintit/shop-os-install 0.5.3 → 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.
- package/bin/shop-os-install.js +17 -2
- package/package.json +1 -1
package/bin/shop-os-install.js
CHANGED
|
@@ -119,8 +119,17 @@ function getClaudeRoot() {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
function checkClaudeCode() {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
// Detect by binary on PATH, not by the ~/.claude directory: when Claude Code
|
|
123
|
+
// is installed via `npm install -g @anthropic-ai/claude-code` (which the
|
|
124
|
+
// setup scripts now do), the .claude directory isn't created until the user
|
|
125
|
+
// launches `claude` for the first time. A binary check correctly identifies
|
|
126
|
+
// installs from npm, the official .ps1/.sh installer, or the desktop app.
|
|
127
|
+
const probe = spawnSync(
|
|
128
|
+
process.platform === "win32" ? "where" : "which",
|
|
129
|
+
["claude"],
|
|
130
|
+
{ stdio: "ignore", shell: false },
|
|
131
|
+
);
|
|
132
|
+
if (probe.status !== 0) {
|
|
124
133
|
print("");
|
|
125
134
|
print(red("Claude Code is not installed."));
|
|
126
135
|
print("");
|
|
@@ -131,6 +140,12 @@ function checkClaudeCode() {
|
|
|
131
140
|
print("re-run this installer.");
|
|
132
141
|
exit(1);
|
|
133
142
|
}
|
|
143
|
+
// Stage ~/.claude so downstream marketplace and plugin writes succeed even
|
|
144
|
+
// if the user hasn't launched `claude` yet to seed the dir themselves.
|
|
145
|
+
const root = getClaudeRoot();
|
|
146
|
+
if (!existsSync(root)) {
|
|
147
|
+
mkdirSync(root, { recursive: true });
|
|
148
|
+
}
|
|
134
149
|
return root;
|
|
135
150
|
}
|
|
136
151
|
|