ancoder-skill-cli 0.13.28 → 0.13.30
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 +53 -18
- package/bin/targets/skill-cli-darwin-arm64 +0 -0
- package/bin/targets/skill-cli-darwin-x64 +0 -0
- package/bin/targets/skill-cli-linux-arm64 +0 -0
- package/bin/targets/skill-cli-linux-x64 +0 -0
- package/bin/targets/skill-cli-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/scripts/check-bin.js +98 -3
- package/scripts/check-install-host.js +2 -2
- package/scripts/install.ps1 +2 -2
- package/scripts/install.sh +19 -7
- package/scripts/make-install-bundle.js +22 -4
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ After install, the wrapper selects the correct bundled binary for the current pl
|
|
|
24
24
|
|
|
25
25
|
## One-line install (Gitee or intranet)
|
|
26
26
|
|
|
27
|
-
For users who cannot access GitHub,
|
|
27
|
+
For users who cannot access GitHub, publish the release-only bundle to Gitee or copy these files to an intranet static file server:
|
|
28
28
|
|
|
29
29
|
- `scripts/install.ps1`
|
|
30
30
|
- `scripts/install.sh`
|
|
@@ -34,40 +34,65 @@ For users who cannot access GitHub, mirror this repository to Gitee or copy thes
|
|
|
34
34
|
- `bin/targets/skill-cli-darwin-arm64`
|
|
35
35
|
- `bin/targets/skill-cli-darwin-x64`
|
|
36
36
|
|
|
37
|
-
Windows users can install
|
|
37
|
+
Windows users can install the latest Gitee release with PowerShell:
|
|
38
38
|
|
|
39
39
|
```powershell
|
|
40
|
-
irm https://gitee.com/marvin-dev/skill-cli-
|
|
40
|
+
irm https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.ps1 | iex
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
macOS/Linux users can install
|
|
43
|
+
macOS/Linux users can install the latest Gitee release with curl:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
curl -fsSL https://gitee.com/marvin-dev/skill-cli-
|
|
46
|
+
curl -fsSL https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.sh | bash
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
The installer downloads the matching prebuilt binary, installs it as `skill-cli`, runs `skill-cli install`, then runs a lite `doctor` check. No Go toolchain is required.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
The `raw/main` URL is the moving latest channel. Each GitHub release updates Gitee `main` with the newest install bundle. If you need a reproducible install, pin a specific release tag instead:
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
irm https://gitee.com/marvin-dev/skill-cli-release/raw/v0.13.30/scripts/install.ps1 | iex
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
curl -fsSL https://gitee.com/marvin-dev/skill-cli-release/raw/v0.13.30/scripts/install.sh | bash
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Before sharing the Gitee command externally, make sure both the Gitee `main` branch and the release tag have been updated. The installer in `main` is generated from the latest release bundle.
|
|
52
62
|
|
|
53
63
|
Gitee release checklist:
|
|
54
64
|
|
|
55
65
|
1. Run `go test ./...`, `bash scripts/build-all.sh`, `node scripts/check-bin.js`, and `npm pack --dry-run`.
|
|
56
66
|
2. Commit `bin/targets/`, `scripts/install.ps1`, `scripts/install.sh`, `scripts/make-install-bundle.js`, `scripts/check-install-host.js`, `scripts/check-bin.js`, `scripts/build-all.sh`, `package.json`, `package-lock.json`, `.gitattributes`, and `README.md`.
|
|
57
|
-
3. Push
|
|
67
|
+
3. Push the release tag to GitHub. The GitHub Actions release workflow builds the binaries and syncs a dist-only bundle to `git@gitee.com:marvin-dev/skill-cli-release.git`.
|
|
58
68
|
4. Verify these URLs return `200` before sending the install command:
|
|
59
|
-
- `https://gitee.com/marvin-dev/skill-cli-
|
|
60
|
-
- `https://gitee.com/marvin-dev/skill-cli-
|
|
61
|
-
- `https://gitee.com/marvin-dev/skill-cli-
|
|
69
|
+
- `https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.ps1`
|
|
70
|
+
- `https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.sh`
|
|
71
|
+
- `https://gitee.com/marvin-dev/skill-cli-release/raw/main/bin/targets/skill-cli-win32-x64.exe`
|
|
72
|
+
- `https://gitee.com/marvin-dev/skill-cli-release/raw/v0.13.30/scripts/install.ps1`
|
|
73
|
+
- `https://gitee.com/marvin-dev/skill-cli-release/raw/v0.13.30/bin/targets/skill-cli-win32-x64.exe`
|
|
62
74
|
Or run:
|
|
63
75
|
|
|
64
76
|
```bash
|
|
65
77
|
node scripts/check-install-host.js \
|
|
66
|
-
--script-root https://gitee.com/marvin-dev/skill-cli-
|
|
67
|
-
--base-url https://gitee.com/marvin-dev/skill-cli-
|
|
78
|
+
--script-root https://gitee.com/marvin-dev/skill-cli-release/raw/main \
|
|
79
|
+
--base-url https://gitee.com/marvin-dev/skill-cli-release/raw/main/bin/targets
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
5. Share the `raw/main` install command only after the check above passes.
|
|
83
|
+
|
|
84
|
+
GitHub Actions Gitee sync setup:
|
|
85
|
+
|
|
86
|
+
1. Create a dedicated SSH key for the Gitee release-only repo:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
ssh-keygen -t ed25519 -C "github-actions skill-cli-release" -f ~/.ssh/skill-cli-release-gitee
|
|
68
90
|
```
|
|
69
91
|
|
|
70
|
-
|
|
92
|
+
2. Add the public key `~/.ssh/skill-cli-release-gitee.pub` to Gitee with write access to `git@gitee.com:marvin-dev/skill-cli-release.git`.
|
|
93
|
+
3. Add the private key content from `~/.ssh/skill-cli-release-gitee` to the GitHub repository secret `GITEE_SSH_PRIVATE_KEY`.
|
|
94
|
+
|
|
95
|
+
The workflow only pushes the generated `dist/install/` bundle to Gitee, so the source repository remains GitHub-only.
|
|
71
96
|
|
|
72
97
|
For private intranet hosting, generate a static install bundle and upload the generated `dist/install/` directory as-is:
|
|
73
98
|
|
|
@@ -114,20 +139,20 @@ Useful options:
|
|
|
114
139
|
```powershell
|
|
115
140
|
# Install the binary only, without writing ~/.claude components
|
|
116
141
|
$env:SKILL_CLI_NO_INSTALL = "1"
|
|
117
|
-
irm https://gitee.com/marvin-dev/skill-cli-
|
|
142
|
+
irm https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.ps1 | iex
|
|
118
143
|
|
|
119
144
|
# For a clean smoke test against a temporary Claude directory
|
|
120
145
|
$env:SKILL_CLI_NO_INSTALL = $null
|
|
121
146
|
$env:SKILL_CLI_CLAUDE_DIR = "$PWD\.skill-cli-test-claude"
|
|
122
|
-
irm https://gitee.com/marvin-dev/skill-cli-
|
|
147
|
+
irm https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.ps1 | iex
|
|
123
148
|
```
|
|
124
149
|
|
|
125
150
|
```bash
|
|
126
151
|
# Install the binary only, without writing ~/.claude components
|
|
127
|
-
curl -fsSL https://gitee.com/marvin-dev/skill-cli-
|
|
152
|
+
curl -fsSL https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.sh | bash -s -- --no-install
|
|
128
153
|
|
|
129
154
|
# For a clean smoke test against a temporary Claude directory
|
|
130
|
-
curl -fsSL https://gitee.com/marvin-dev/skill-cli-
|
|
155
|
+
curl -fsSL https://gitee.com/marvin-dev/skill-cli-release/raw/main/scripts/install.sh | \
|
|
131
156
|
bash -s -- --claude-dir "$PWD/.skill-cli-test-claude"
|
|
132
157
|
```
|
|
133
158
|
|
|
@@ -191,9 +216,19 @@ The evaluator fails the run when critical issues are found or the score is below
|
|
|
191
216
|
|
|
192
217
|
Use `--no-adversarial` if you want the older OMC-only generation behavior.
|
|
193
218
|
|
|
219
|
+
### Generation failure logs
|
|
220
|
+
|
|
221
|
+
Every `skill-cli generate` run writes a local JSONL session log under:
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
<skills-dir>/.skill-cli/logs/generate/<skill-name>-<timestamp>.jsonl
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
When generation fails, the CLI prints the exact log path. The log records major stages such as Claude binary resolution, scaffold creation, brainstorm probe, loop start/ticks, deterministic gates, repair attempts, and adversarial review failures, including captured command output and error tails for troubleshooting.
|
|
228
|
+
|
|
194
229
|
## Publish to npm
|
|
195
230
|
|
|
196
|
-
Releases are published by GitHub Actions, not by running `npm publish` from a developer machine. The workflow in `.github/workflows/release.yml` runs when a `v*` tag is pushed; it builds the release binaries, creates the GitHub Release, prepares `bin/targets/` for the npm package, and publishes with the repository `NPM_TOKEN` secret.
|
|
231
|
+
Releases are published by GitHub Actions, not by running `npm publish` from a developer machine. The workflow in `.github/workflows/release.yml` runs when a `v*` tag is pushed; it builds the release binaries, creates the GitHub Release, syncs a release-only install bundle to Gitee, prepares `bin/targets/` for the npm package, and publishes with the repository `NPM_TOKEN` secret.
|
|
197
232
|
|
|
198
233
|
1. Bump `package.json` and `package-lock.json` to the intended version.
|
|
199
234
|
2. Run local verification:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ancoder-skill-cli",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.30",
|
|
4
4
|
"description": "CLI for managing everything-claude-code (ECC) components — agents, skills, commands, rules, hooks, MCP configs. Single binary, all assets embedded.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"skill-cli": "bin/skill-cli.js"
|
package/scripts/check-bin.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const childProcess = require('child_process');
|
|
6
8
|
|
|
7
9
|
const rootDir = path.join(__dirname, '..');
|
|
8
10
|
const binDir = path.join(__dirname, '..', 'bin');
|
|
@@ -54,7 +56,6 @@ if (missingInstallerFilesEntries.length > 0) {
|
|
|
54
56
|
process.exit(1);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
const expectedVersion = `v${pkg.version}`;
|
|
58
59
|
const installerVersionPatterns = [
|
|
59
60
|
{
|
|
60
61
|
file: 'scripts/install.sh',
|
|
@@ -74,8 +75,102 @@ for (const item of installerVersionPatterns) {
|
|
|
74
75
|
console.error(`skill-cli: could not find default version in ${item.file}`);
|
|
75
76
|
process.exit(1);
|
|
76
77
|
}
|
|
77
|
-
if (match[1] !==
|
|
78
|
-
console.error(`skill-cli: ${item.file} default version is ${match[1]}, expected
|
|
78
|
+
if (match[1] !== 'main') {
|
|
79
|
+
console.error(`skill-cli: ${item.file} default version is ${match[1]}, expected main`);
|
|
79
80
|
process.exit(1);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
83
|
+
|
|
84
|
+
function currentPlatformAsset() {
|
|
85
|
+
let platform = os.platform();
|
|
86
|
+
let arch = os.arch();
|
|
87
|
+
|
|
88
|
+
if (platform === 'darwin') {
|
|
89
|
+
platform = 'darwin';
|
|
90
|
+
} else if (platform === 'linux') {
|
|
91
|
+
platform = 'linux';
|
|
92
|
+
} else if (platform === 'win32') {
|
|
93
|
+
platform = 'win32';
|
|
94
|
+
} else {
|
|
95
|
+
throw new Error(`unsupported installer smoke platform: ${platform}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (arch === 'x64') {
|
|
99
|
+
arch = 'x64';
|
|
100
|
+
} else if (arch === 'arm64') {
|
|
101
|
+
arch = 'arm64';
|
|
102
|
+
} else {
|
|
103
|
+
throw new Error(`unsupported installer smoke architecture: ${arch}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (platform === 'win32') {
|
|
107
|
+
if (arch !== 'x64') {
|
|
108
|
+
throw new Error(`unsupported Windows installer smoke architecture: ${arch}`);
|
|
109
|
+
}
|
|
110
|
+
return 'skill-cli-win32-x64.exe';
|
|
111
|
+
}
|
|
112
|
+
return `skill-cli-${platform}-${arch}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function runInstallerSmoke() {
|
|
116
|
+
if (process.platform === 'win32') {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-cli-installer-smoke-'));
|
|
121
|
+
try {
|
|
122
|
+
const sourceDir = path.join(tmpDir, 'source');
|
|
123
|
+
const installDir = path.join(tmpDir, 'install');
|
|
124
|
+
fs.mkdirSync(sourceDir, { recursive: true });
|
|
125
|
+
fs.mkdirSync(installDir, { recursive: true });
|
|
126
|
+
|
|
127
|
+
const assetPath = path.join(sourceDir, currentPlatformAsset());
|
|
128
|
+
fs.writeFileSync(assetPath, `#!/usr/bin/env bash
|
|
129
|
+
set -euo pipefail
|
|
130
|
+
case "\${1:-}" in
|
|
131
|
+
version)
|
|
132
|
+
echo "skill-cli version smoke"
|
|
133
|
+
;;
|
|
134
|
+
install|doctor)
|
|
135
|
+
echo "skill-cli \${1} smoke"
|
|
136
|
+
;;
|
|
137
|
+
*)
|
|
138
|
+
echo "unexpected skill-cli smoke command: $*" >&2
|
|
139
|
+
exit 2
|
|
140
|
+
;;
|
|
141
|
+
esac
|
|
142
|
+
`);
|
|
143
|
+
fs.chmodSync(assetPath, 0o755);
|
|
144
|
+
|
|
145
|
+
const installScript = path.join(rootDir, 'scripts', 'install.sh');
|
|
146
|
+
childProcess.execFileSync('bash', [
|
|
147
|
+
installScript,
|
|
148
|
+
'--base-url',
|
|
149
|
+
`file://${sourceDir}`,
|
|
150
|
+
'--install-dir',
|
|
151
|
+
installDir,
|
|
152
|
+
'--no-install',
|
|
153
|
+
'--doctor',
|
|
154
|
+
'none',
|
|
155
|
+
], {
|
|
156
|
+
cwd: rootDir,
|
|
157
|
+
stdio: 'pipe',
|
|
158
|
+
env: { ...process.env, SKILL_CLI_BASE_URL: '' },
|
|
159
|
+
});
|
|
160
|
+
} catch (err) {
|
|
161
|
+
const stdout = err.stdout ? err.stdout.toString() : '';
|
|
162
|
+
const stderr = err.stderr ? err.stderr.toString() : '';
|
|
163
|
+
console.error('skill-cli: install.sh smoke failed');
|
|
164
|
+
if (stdout.trim()) {
|
|
165
|
+
console.error(stdout.trim());
|
|
166
|
+
}
|
|
167
|
+
if (stderr.trim()) {
|
|
168
|
+
console.error(stderr.trim());
|
|
169
|
+
}
|
|
170
|
+
throw err;
|
|
171
|
+
} finally {
|
|
172
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
runInstallerSmoke();
|
|
@@ -32,8 +32,8 @@ function usage() {
|
|
|
32
32
|
Examples:
|
|
33
33
|
node scripts/check-install-host.js --root https://intranet.example.com/skill-cli
|
|
34
34
|
node scripts/check-install-host.js \\
|
|
35
|
-
--script-root https://gitee.com/marvin-dev/skill-cli-
|
|
36
|
-
--base-url https://gitee.com/marvin-dev/skill-cli-
|
|
35
|
+
--script-root https://gitee.com/marvin-dev/skill-cli-release/raw/main \\
|
|
36
|
+
--base-url https://gitee.com/marvin-dev/skill-cli-release/raw/main/bin/targets
|
|
37
37
|
|
|
38
38
|
Checks installer scripts and the Windows binary by default. Pass --all-binaries
|
|
39
39
|
to verify every bundled platform binary.`);
|
package/scripts/install.ps1
CHANGED
|
@@ -35,11 +35,11 @@ if (Test-TruthyEnv $env:SKILL_CLI_DRY_RUN) {
|
|
|
35
35
|
$baseUrlWasProvided = [bool]$BaseUrl
|
|
36
36
|
|
|
37
37
|
if (-not $Version) {
|
|
38
|
-
$Version = "
|
|
38
|
+
$Version = "main"
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (-not $BaseUrl) {
|
|
42
|
-
$BaseUrl = "https://gitee.com/marvin-dev/skill-cli-
|
|
42
|
+
$BaseUrl = "https://gitee.com/marvin-dev/skill-cli-release/raw/$Version/bin/targets"
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (-not $InstallDir) {
|
package/scripts/install.sh
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
DEFAULT_VERSION="
|
|
4
|
+
DEFAULT_VERSION="main"
|
|
5
5
|
VERSION="${SKILL_CLI_VERSION:-$DEFAULT_VERSION}"
|
|
6
|
-
DEFAULT_BASE_URL="https://gitee.com/marvin-dev/skill-cli-
|
|
6
|
+
DEFAULT_BASE_URL="https://gitee.com/marvin-dev/skill-cli-release/raw/${VERSION}/bin/targets"
|
|
7
7
|
DEFAULT_BASE_URL_USES_VERSION=1
|
|
8
8
|
BASE_URL="${SKILL_CLI_BASE_URL:-$DEFAULT_BASE_URL}"
|
|
9
9
|
BASE_URL_EXPLICIT=0
|
|
@@ -36,7 +36,7 @@ Options:
|
|
|
36
36
|
|
|
37
37
|
Environment:
|
|
38
38
|
SKILL_CLI_BASE_URL Same as --base-url.
|
|
39
|
-
SKILL_CLI_VERSION Same as --version. Default:
|
|
39
|
+
SKILL_CLI_VERSION Same as --version. Default: main.
|
|
40
40
|
SKILL_CLI_INSTALL_DIR Same as --install-dir.
|
|
41
41
|
SKILL_CLI_CLAUDE_DIR Same as --claude-dir.
|
|
42
42
|
SKILL_CLI_DOCTOR Same as --doctor.
|
|
@@ -53,7 +53,7 @@ while [ "$#" -gt 0 ]; do
|
|
|
53
53
|
--version)
|
|
54
54
|
VERSION="${2:?missing value for --version}"
|
|
55
55
|
if [ "$BASE_URL_EXPLICIT" = "0" ] && [ "$DEFAULT_BASE_URL_USES_VERSION" = "1" ]; then
|
|
56
|
-
BASE_URL="https://gitee.com/marvin-dev/skill-cli-
|
|
56
|
+
BASE_URL="https://gitee.com/marvin-dev/skill-cli-release/raw/${VERSION}/bin/targets"
|
|
57
57
|
fi
|
|
58
58
|
shift 2
|
|
59
59
|
;;
|
|
@@ -188,17 +188,29 @@ fi
|
|
|
188
188
|
|
|
189
189
|
if [ "$RUN_COMPONENT_INSTALL" = "1" ]; then
|
|
190
190
|
echo ""
|
|
191
|
-
|
|
191
|
+
if [ "${#claude_args[@]}" -gt 0 ]; then
|
|
192
|
+
"$TARGET_PATH" install "${claude_args[@]}"
|
|
193
|
+
else
|
|
194
|
+
"$TARGET_PATH" install
|
|
195
|
+
fi
|
|
192
196
|
fi
|
|
193
197
|
|
|
194
198
|
case "$DOCTOR_MODE" in
|
|
195
199
|
lite)
|
|
196
200
|
echo ""
|
|
197
|
-
|
|
201
|
+
if [ "${#claude_args[@]}" -gt 0 ]; then
|
|
202
|
+
"$TARGET_PATH" doctor "${claude_args[@]}" --check-adversarial=false
|
|
203
|
+
else
|
|
204
|
+
"$TARGET_PATH" doctor --check-adversarial=false
|
|
205
|
+
fi
|
|
198
206
|
;;
|
|
199
207
|
full)
|
|
200
208
|
echo ""
|
|
201
|
-
|
|
209
|
+
if [ "${#claude_args[@]}" -gt 0 ]; then
|
|
210
|
+
"$TARGET_PATH" doctor "${claude_args[@]}"
|
|
211
|
+
else
|
|
212
|
+
"$TARGET_PATH" doctor
|
|
213
|
+
fi
|
|
202
214
|
;;
|
|
203
215
|
none)
|
|
204
216
|
;;
|
|
@@ -19,6 +19,7 @@ const targets = [
|
|
|
19
19
|
const args = process.argv.slice(2);
|
|
20
20
|
let baseURL = '';
|
|
21
21
|
let rootURL = '';
|
|
22
|
+
let scriptRootURL = '';
|
|
22
23
|
for (let i = 0; i < args.length; i += 1) {
|
|
23
24
|
if (args[i] === '--base-url') {
|
|
24
25
|
baseURL = args[i + 1] || '';
|
|
@@ -26,15 +27,20 @@ for (let i = 0; i < args.length; i += 1) {
|
|
|
26
27
|
} else if (args[i] === '--root') {
|
|
27
28
|
rootURL = args[i + 1] || '';
|
|
28
29
|
i += 1;
|
|
30
|
+
} else if (args[i] === '--script-root') {
|
|
31
|
+
scriptRootURL = args[i + 1] || '';
|
|
32
|
+
i += 1;
|
|
29
33
|
} else if (args[i] === '-h' || args[i] === '--help') {
|
|
30
34
|
console.log(`Usage:
|
|
31
35
|
node scripts/make-install-bundle.js [--root URL]
|
|
32
36
|
node scripts/make-install-bundle.js [--base-url URL]
|
|
37
|
+
node scripts/make-install-bundle.js [--base-url URL] [--script-root URL]
|
|
33
38
|
|
|
34
39
|
Creates dist/install/ with one-line installer scripts and prebuilt binaries.
|
|
35
40
|
When --root is provided, generated installer copies default to ROOT/bin/targets.
|
|
36
41
|
When --base-url is provided, generated installer copies default to that URL
|
|
37
|
-
for binary downloads, which is useful for intranet static hosting
|
|
42
|
+
for binary downloads, which is useful for intranet static hosting.
|
|
43
|
+
When --script-root is provided, README examples point to SCRIPT_ROOT/scripts.`);
|
|
38
44
|
process.exit(0);
|
|
39
45
|
} else {
|
|
40
46
|
console.error(`unknown option: ${args[i]}`);
|
|
@@ -56,6 +62,10 @@ if (rootURL) {
|
|
|
56
62
|
baseURL = `${rootURL}/bin/targets`;
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
if (scriptRootURL) {
|
|
66
|
+
scriptRootURL = trimSlash(scriptRootURL);
|
|
67
|
+
}
|
|
68
|
+
|
|
59
69
|
function copyFile(src, dest) {
|
|
60
70
|
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
61
71
|
fs.copyFileSync(src, dest);
|
|
@@ -80,17 +90,24 @@ for (const target of targets) {
|
|
|
80
90
|
let installSH = fs.readFileSync(path.join(rootDir, 'scripts', 'install.sh'), 'utf8');
|
|
81
91
|
let installPS1 = fs.readFileSync(path.join(rootDir, 'scripts', 'install.ps1'), 'utf8');
|
|
82
92
|
|
|
93
|
+
installSH = installSH.replace(/DEFAULT_VERSION="[^"]+"/, `DEFAULT_VERSION="${version}"`);
|
|
94
|
+
installSH = installSH.replace(
|
|
95
|
+
/SKILL_CLI_VERSION Same as --version\. Default: [^\n]+/,
|
|
96
|
+
`SKILL_CLI_VERSION Same as --version. Default: ${version}.`
|
|
97
|
+
);
|
|
98
|
+
installPS1 = installPS1.replace(/\$Version = "[^"]+"/, `$Version = "${version}"`);
|
|
99
|
+
|
|
83
100
|
if (baseURL) {
|
|
84
101
|
const normalizedBaseURL = trimSlash(baseURL);
|
|
85
102
|
installSH = installSH.replace(
|
|
86
|
-
/DEFAULT_BASE_URL="https:\/\/gitee\.com\/marvin-dev\/skill-cli-
|
|
103
|
+
/DEFAULT_BASE_URL="https:\/\/gitee\.com\/marvin-dev\/skill-cli-release\/raw\/\$\{VERSION\}\/bin\/targets"/,
|
|
87
104
|
`DEFAULT_BASE_URL="${normalizedBaseURL}"`
|
|
88
105
|
).replace(
|
|
89
106
|
/DEFAULT_BASE_URL_USES_VERSION=1/,
|
|
90
107
|
'DEFAULT_BASE_URL_USES_VERSION=0'
|
|
91
108
|
);
|
|
92
109
|
installPS1 = installPS1.replace(
|
|
93
|
-
/\$BaseUrl = "https:\/\/gitee\.com\/marvin-dev\/skill-cli-
|
|
110
|
+
/\$BaseUrl = "https:\/\/gitee\.com\/marvin-dev\/skill-cli-release\/raw\/\$Version\/bin\/targets"/,
|
|
94
111
|
`$BaseUrl = "${normalizedBaseURL}"`
|
|
95
112
|
);
|
|
96
113
|
}
|
|
@@ -104,6 +121,7 @@ const manifest = {
|
|
|
104
121
|
tag: version,
|
|
105
122
|
generatedAt: new Date().toISOString(),
|
|
106
123
|
rootURL: rootURL || null,
|
|
124
|
+
scriptRootURL: scriptRootURL || null,
|
|
107
125
|
baseURL: baseURL || null,
|
|
108
126
|
files: [
|
|
109
127
|
'scripts/install.ps1',
|
|
@@ -121,7 +139,7 @@ function inferInstallRootFromBaseURL(value) {
|
|
|
121
139
|
return '<your-hosted-root>';
|
|
122
140
|
}
|
|
123
141
|
|
|
124
|
-
const installRoot = rootURL || (baseURL ? inferInstallRootFromBaseURL(baseURL) : `https://gitee.com/marvin-dev/skill-cli-
|
|
142
|
+
const installRoot = scriptRootURL || rootURL || (baseURL ? inferInstallRootFromBaseURL(baseURL) : `https://gitee.com/marvin-dev/skill-cli-release/raw/${version}`);
|
|
125
143
|
const psURL = baseURL ? `${installRoot}/scripts/install.ps1` : `${installRoot}/scripts/install.ps1`;
|
|
126
144
|
const shURL = baseURL ? `${installRoot}/scripts/install.sh` : `${installRoot}/scripts/install.sh`;
|
|
127
145
|
|