@delta-infra/cli 1.0.68 → 1.0.70
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 -2
- package/checksums.txt +5 -5
- package/package.json +1 -1
- package/scripts/install-wizard.js +28 -15
package/README.md
CHANGED
|
@@ -131,7 +131,7 @@ go install github.com/delta-infra/delta-infra-cli/cmd/delta-cli@latest
|
|
|
131
131
|
delta-cli config init
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
执行时会交互式提示输入服务端地址(默认:`
|
|
134
|
+
执行时会交互式提示输入服务端地址(默认:`https://delta-infra-nacos-test.yangtzeailab.com/sandbox/api/v1`)以及 Bearer Token(可选,也可后续用 `auth login` 配置)。
|
|
135
135
|
|
|
136
136
|
非交互式环境(如 CI)会直接使用默认值,也可以通过 flag 或环境变量一次性指定:
|
|
137
137
|
|
|
@@ -375,7 +375,7 @@ make release
|
|
|
375
375
|
```bash
|
|
376
376
|
export GH_TOKEN=<your-github-pat>
|
|
377
377
|
export NPM_TOKEN=<your-npm-token>
|
|
378
|
-
./release.sh v1.0.
|
|
378
|
+
./release.sh v1.0.70
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
脚本执行步骤:
|
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
af5ff4a7832f6d7b84d58c128e1ec4275b4f9c0af9ae4d95e83f78f69da2e6ad delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
23ff7deb342c39dce91af911e58ab2e6a3232b0c75d4ba6f77471b0513b25863 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
1e4545d4bbd69b190aa83c65a59e8009e37f2c68d715613dc8185a51bdc495ed delta-cli-linux-amd64.tar.gz
|
|
4
|
+
846ece621a8030606004dfc398dabc0e1889fb4c34c18e7094ced9ba159f4fc4 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
4cd39c137560399d967e2fad4c175a5902b79767f6f6cb05c66a06c7a82f4b66 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -12,6 +12,8 @@ const SKILLS_REPO = "yzailab/delta-infra-cli";
|
|
|
12
12
|
const NPM_REGISTRIES = ["https://registry.npmmirror.com", "https://registry.npmjs.org"];
|
|
13
13
|
const GH_MIRRORS = ["https://gh.ddlc.top", "https://ghproxy.net", "https://gh-proxy.com"];
|
|
14
14
|
const CONFIG_DIR = path.join(osHomedir(), ".delta-infra");
|
|
15
|
+
const CONFIG_VERSION = 1;
|
|
16
|
+
const DEFAULT_BASE_URL = "https://delta-infra-nacos-test.yangtzeailab.com/sandbox/api/v1";
|
|
15
17
|
const isWindows = process.platform === "win32";
|
|
16
18
|
|
|
17
19
|
const PLATFORM_PATHS = {
|
|
@@ -234,6 +236,21 @@ function getExistingConfig() {
|
|
|
234
236
|
} catch { return null; }
|
|
235
237
|
}
|
|
236
238
|
|
|
239
|
+
function writeDefaultConfig(existing = null) {
|
|
240
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
241
|
+
const config = {
|
|
242
|
+
version: CONFIG_VERSION,
|
|
243
|
+
base_url: DEFAULT_BASE_URL,
|
|
244
|
+
};
|
|
245
|
+
if (existing && existing.token) {
|
|
246
|
+
config.token = existing.token;
|
|
247
|
+
}
|
|
248
|
+
if (existing && existing.science_base_url) {
|
|
249
|
+
config.science_base_url = existing.science_base_url;
|
|
250
|
+
}
|
|
251
|
+
fs.writeFileSync(path.join(CONFIG_DIR, "config.json"), JSON.stringify(config, null, 2) + "\n", { mode: 0o600 });
|
|
252
|
+
}
|
|
253
|
+
|
|
237
254
|
// ── Steps ───────────────────────────────────────────────────────────────────
|
|
238
255
|
|
|
239
256
|
async function stepInstallGlobally(msg) {
|
|
@@ -393,33 +410,29 @@ async function stepConfigInit(msg) {
|
|
|
393
410
|
const s = createSpinner();
|
|
394
411
|
s.start(msg.step3);
|
|
395
412
|
|
|
396
|
-
const deltaCli = whichDeltaCli();
|
|
397
|
-
if (!deltaCli) {
|
|
398
|
-
s.stop(msg.step3);
|
|
399
|
-
p.log.warn("delta-cli not found on PATH after global install.");
|
|
400
|
-
p.log.info(msg.step3Fail);
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// Check if config already exists with valid data
|
|
405
413
|
const existingConfig = getExistingConfig();
|
|
406
|
-
s.stop(msg.step3);
|
|
407
414
|
|
|
408
415
|
if (existingConfig && existingConfig.base_url) {
|
|
416
|
+
s.stop(msg.step3);
|
|
409
417
|
const reuse = await p.confirm({
|
|
410
418
|
message: `发现已有配置 (Server: ${existingConfig.base_url}),继续使用?`,
|
|
411
419
|
});
|
|
412
|
-
if (
|
|
420
|
+
if (p.isCancel(reuse)) {
|
|
421
|
+
handleCancel(reuse, msg);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (reuse) {
|
|
413
425
|
p.log.info(msg.step3Skip);
|
|
414
426
|
return;
|
|
415
427
|
}
|
|
416
428
|
}
|
|
417
429
|
|
|
418
430
|
try {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
} catch {
|
|
422
|
-
|
|
431
|
+
writeDefaultConfig(existingConfig);
|
|
432
|
+
s.stop(msg.step3Done);
|
|
433
|
+
} catch (e) {
|
|
434
|
+
s.stop(msg.step3Fail);
|
|
435
|
+
p.log.error(e.message || String(e));
|
|
423
436
|
process.exit(1);
|
|
424
437
|
}
|
|
425
438
|
}
|