@dongnanyang/deploy-cli 0.6.0 → 0.6.1
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/dist/bin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const argv = process.argv.slice(2);
|
|
3
3
|
if (argv.length === 0 || argv[0] === "tui") await import("./main.js");
|
|
4
4
|
else {
|
|
5
|
-
const cli = await import("./cli-
|
|
5
|
+
const cli = await import("./cli-DEqPcFVu.js");
|
|
6
6
|
process.exitCode = await cli.main(argv);
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
@@ -235,9 +235,11 @@ function logsArgs(idOrName, o) {
|
|
|
235
235
|
args.push(idOrName);
|
|
236
236
|
return args;
|
|
237
237
|
}
|
|
238
|
-
/** 失败信息:命令原文 + exit 码 + stderr
|
|
238
|
+
/** 失败信息:命令原文 + exit 码 + stderr 摘要(优先 error/fatal/failed 行,无则取尾部 3 行——docker compose 等工具把进度打在 stderr 前部,取前 3 行会挤掉真错误) */
|
|
239
239
|
function execFailureMessage(cmd, args, result) {
|
|
240
|
-
const
|
|
240
|
+
const lines = result.stderr.trim().split("\n").filter((line) => line.trim() !== "");
|
|
241
|
+
const errors = lines.filter((line) => /error|fatal|failed/i.test(line));
|
|
242
|
+
const summary = (errors.length > 0 ? errors.slice(-3) : lines.slice(-3)).join(" ");
|
|
241
243
|
return `命令失败: ${[cmd, ...args].join(" ")}(exit ${result.code})${summary ? `: ${summary}` : "(stderr 无输出)"}`;
|
|
242
244
|
}
|
|
243
245
|
/** 把 Runner 的 (line, stream) 回调适配为 DockerApi 的 (l) => void */
|