@silicaclaw/cli 1.0.0-beta.31 → 1.0.0-beta.32
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/README.md +2 -0
- package/package.json +1 -1
- package/scripts/silicaclaw-cli.mjs +8 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -122,6 +122,10 @@ function userEnvFile() {
|
|
|
122
122
|
return resolve(homedir(), ".silicaclaw", "env.sh");
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
function userNpmCacheDir() {
|
|
126
|
+
return resolve(homedir(), ".silicaclaw", "npm-cache");
|
|
127
|
+
}
|
|
128
|
+
|
|
125
129
|
function ensureLineInFile(filePath, block) {
|
|
126
130
|
try {
|
|
127
131
|
const current = existsSync(filePath) ? readFileSync(filePath, "utf8") : "";
|
|
@@ -190,9 +194,11 @@ function installPersistentCommand() {
|
|
|
190
194
|
const binDir = userShimDir();
|
|
191
195
|
const shimPath = userShimPath();
|
|
192
196
|
const envFile = userEnvFile();
|
|
197
|
+
const npmCacheDir = userNpmCacheDir();
|
|
193
198
|
const envBlock = [
|
|
194
199
|
"#!/usr/bin/env bash",
|
|
195
200
|
'export PATH="$HOME/.silicaclaw/bin:$PATH"',
|
|
201
|
+
'export npm_config_cache="$HOME/.silicaclaw/npm-cache"',
|
|
196
202
|
"",
|
|
197
203
|
].join("\n");
|
|
198
204
|
const rcBlock = [
|
|
@@ -202,12 +208,14 @@ function installPersistentCommand() {
|
|
|
202
208
|
].join("\n");
|
|
203
209
|
|
|
204
210
|
mkdirSync(binDir, { recursive: true });
|
|
211
|
+
mkdirSync(npmCacheDir, { recursive: true });
|
|
205
212
|
writeFileSync(envFile, envBlock, { encoding: "utf8", mode: 0o755 });
|
|
206
213
|
writeFileSync(
|
|
207
214
|
shimPath,
|
|
208
215
|
[
|
|
209
216
|
"#!/usr/bin/env bash",
|
|
210
217
|
"set -euo pipefail",
|
|
218
|
+
'export npm_config_cache="${npm_config_cache:-$HOME/.silicaclaw/npm-cache}"',
|
|
211
219
|
'exec npx -y @silicaclaw/cli@beta "$@"',
|
|
212
220
|
"",
|
|
213
221
|
].join("\n"),
|