fleetfizz 0.5.1 → 0.5.2
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/fleetfizz.mjs +112 -110
- package/package.json +1 -1
package/dist/fleetfizz.mjs
CHANGED
|
@@ -32440,7 +32440,7 @@ const runWith = (command, config) => {
|
|
|
32440
32440
|
};
|
|
32441
32441
|
//#endregion
|
|
32442
32442
|
//#region package.json
|
|
32443
|
-
var version = "0.5.
|
|
32443
|
+
var version = "0.5.2";
|
|
32444
32444
|
//#endregion
|
|
32445
32445
|
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
32446
32446
|
/**
|
|
@@ -35274,7 +35274,7 @@ const stampText = (text, stamp) => {
|
|
|
35274
35274
|
const fleet = machinesOf(previous);
|
|
35275
35275
|
const shippedTo = {
|
|
35276
35276
|
...Object.fromEntries(Object.entries(shippedToOf(previous)).filter(([name]) => fleet.includes(name))),
|
|
35277
|
-
...Object.fromEntries(stamp.reached.map((name) => [name, stamp.shippedAt]))
|
|
35277
|
+
...Object.fromEntries([...stamp.reached, ...stamp.own === void 0 ? [] : [stamp.own]].map((name) => [name, stamp.shippedAt]))
|
|
35278
35278
|
};
|
|
35279
35279
|
let out = set(text, "shippedAt", stamp.shippedAt);
|
|
35280
35280
|
out = set(out, "shippedFrom", stamp.shippedFrom);
|
|
@@ -35292,6 +35292,7 @@ const shippedToOf = (config) => {
|
|
|
35292
35292
|
return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
|
|
35293
35293
|
};
|
|
35294
35294
|
const isNewer = (remote, local) => remote !== void 0 && (local === void 0 || remote > local);
|
|
35295
|
+
const staleCopies = (config, copies, own) => copies.filter((c) => c.machine !== own && isNewer(c.config.shippedTo?.[c.machine], config.shippedTo?.[c.machine]));
|
|
35295
35296
|
//#endregion
|
|
35296
35297
|
//#region ../../packages/remote/src/shell.ts
|
|
35297
35298
|
const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
@@ -35319,11 +35320,11 @@ const fingerprintFn = [
|
|
|
35319
35320
|
"}"
|
|
35320
35321
|
].join("\n");
|
|
35321
35322
|
//#endregion
|
|
35322
|
-
//#region ../../packages/remote/src/
|
|
35323
|
+
//#region ../../packages/remote/src/check.ts
|
|
35323
35324
|
const STATE_DIR = "~/.local/state/fleetfizz";
|
|
35324
35325
|
const RECORDS_DIR = `${STATE_DIR}/records`;
|
|
35325
35326
|
const CONFIG_DIR_SH = "\"${XDG_CONFIG_HOME:-$HOME/.config}/fleetfizz\"";
|
|
35326
|
-
const
|
|
35327
|
+
const checkScript = (input) => {
|
|
35327
35328
|
const lines = [
|
|
35328
35329
|
prelude,
|
|
35329
35330
|
fingerprintFn,
|
|
@@ -35816,6 +35817,7 @@ const doneLine = (id, ok, code) => code === void 0 ? `printf 'ff-done {"id":"%s"
|
|
|
35816
35817
|
const jsonString = encodeSync(fromJsonString(String$5));
|
|
35817
35818
|
const jsonRecord = encodeSync(fromJsonString(Record(String$5, String$5)));
|
|
35818
35819
|
const stepId = (repo, step) => `repo:${repo}:${step}`;
|
|
35820
|
+
const isFetchStep = (id) => id.startsWith("repo:") && id.endsWith(":fetch");
|
|
35819
35821
|
const vpStepId = (step) => step.kind === "reinstall" ? `vp:reinstall:${step.name}` : step.kind === "globals" ? "vp:globals" : `vp:${step.kind}`;
|
|
35820
35822
|
const CONFIG_STEP = "config";
|
|
35821
35823
|
const VP_INSTALL = [
|
|
@@ -35823,6 +35825,15 @@ const VP_INSTALL = [
|
|
|
35823
35825
|
...vpEnv.split("\n"),
|
|
35824
35826
|
"{ hash -r 2>/dev/null || true; }"
|
|
35825
35827
|
].join(" && ");
|
|
35828
|
+
const marked = (id, run, then = []) => [
|
|
35829
|
+
stepLine(id),
|
|
35830
|
+
...run,
|
|
35831
|
+
`ff_code=$?`,
|
|
35832
|
+
`if [ "$ff_code" -ne 0 ]; then ${doneLine(id, false, "$ff_code")}; else`,
|
|
35833
|
+
doneLine(id, true),
|
|
35834
|
+
...then,
|
|
35835
|
+
"fi"
|
|
35836
|
+
];
|
|
35826
35837
|
const vpStep = (step) => {
|
|
35827
35838
|
const id = vpStepId(step);
|
|
35828
35839
|
const command = (() => {
|
|
@@ -35834,22 +35845,12 @@ const vpStep = (step) => {
|
|
|
35834
35845
|
case "globals": return `command vp install -g ${step.packages.map((p) => quote(`${p.name}@${p.version}`)).join(" ")}`;
|
|
35835
35846
|
}
|
|
35836
35847
|
})();
|
|
35837
|
-
return [
|
|
35838
|
-
stepLine(id),
|
|
35839
|
-
step.kind === "bootstrap" ? command : `( ${command} )`,
|
|
35840
|
-
`ff_code=$?`,
|
|
35841
|
-
`if [ "$ff_code" -ne 0 ]; then ${doneLine(id, false, "$ff_code")}; else ${doneLine(id, true)}; fi`
|
|
35842
|
-
];
|
|
35848
|
+
return marked(id, [step.kind === "bootstrap" ? command : `( ${command} )`]);
|
|
35843
35849
|
};
|
|
35844
35850
|
const configStep = () => {
|
|
35845
35851
|
const dir = CONFIG_DIR_SH;
|
|
35846
35852
|
const write = (variable, file) => `printf '%s' "$${variable}" | base64 -d > ${dir}/${quote(`${file}.tmp`)} && mv -f ${dir}/${quote(`${file}.tmp`)} ${dir}/${quote(file)}`;
|
|
35847
|
-
return [
|
|
35848
|
-
stepLine(CONFIG_STEP),
|
|
35849
|
-
`( mkdir -p ${dir} && ${write("ff_config", CONFIG_FILE)} && ${write("ff_schema", SCHEMA_FILE)} )`,
|
|
35850
|
-
`ff_code=$?`,
|
|
35851
|
-
`if [ "$ff_code" -ne 0 ]; then ${doneLine(CONFIG_STEP, false, "$ff_code")}; else ${doneLine(CONFIG_STEP, true)}; fi`
|
|
35852
|
-
];
|
|
35853
|
+
return marked(CONFIG_STEP, [`( mkdir -p ${dir} && ${write("ff_config", CONFIG_FILE)} && ${write("ff_schema", SCHEMA_FILE)} )`]);
|
|
35853
35854
|
};
|
|
35854
35855
|
const writeRecord = (repo) => {
|
|
35855
35856
|
return [
|
|
@@ -35874,34 +35875,32 @@ const repoSteps = (repo, input) => {
|
|
|
35874
35875
|
return [
|
|
35875
35876
|
`ff_d="$ff_root"/${quote(repo.name)}`,
|
|
35876
35877
|
`ff_before=$(git -C "$ff_d" rev-parse HEAD 2>/dev/null || true)`,
|
|
35877
|
-
|
|
35878
|
-
|
|
35879
|
-
|
|
35880
|
-
|
|
35881
|
-
|
|
35882
|
-
|
|
35883
|
-
|
|
35884
|
-
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
|
|
35893
|
-
|
|
35894
|
-
|
|
35895
|
-
|
|
35896
|
-
|
|
35897
|
-
|
|
35898
|
-
|
|
35899
|
-
|
|
35900
|
-
|
|
35901
|
-
|
|
35902
|
-
|
|
35903
|
-
"fi",
|
|
35904
|
-
"fi"
|
|
35878
|
+
...marked(fetch, [
|
|
35879
|
+
"(",
|
|
35880
|
+
" set -e",
|
|
35881
|
+
` if [ ! -d "$ff_d/.git" ]; then ff_git clone --quiet ${quote(url)} "$ff_d"; fi`,
|
|
35882
|
+
` if [ "$(git -C "$ff_d" remote get-url origin)" != ${quote(url)} ]; then echo "origin is $(git -C "$ff_d" remote get-url origin), expected ${url}"; exit 1; fi`,
|
|
35883
|
+
...sync.map((l) => ` ${l}`),
|
|
35884
|
+
` git -C "$ff_d" clean --quiet -fd`,
|
|
35885
|
+
...writeFiles(repo).map((l) => ` ${l}`),
|
|
35886
|
+
")"
|
|
35887
|
+
], [
|
|
35888
|
+
`ff_after=$(git -C "$ff_d" rev-parse HEAD)`,
|
|
35889
|
+
`ff_state "{\\"fact\\":\\"repo\\",\\"name\\":\\"$(ff_json ${quote(repo.name)})\\",\\"present\\":true,\\"head\\":\\"$(ff_json "$ff_after")\\"}"`,
|
|
35890
|
+
`if [ ${repo.decision.run ? "true" : "false"} = true ] || [ "$ff_after" != "$ff_before" ]; then`,
|
|
35891
|
+
` ${stepLine(install)}`,
|
|
35892
|
+
` (cd "$ff_d" && ${envPrefix} "\${SHELL:-/bin/sh}" -lc ${quote(repo.install)})`,
|
|
35893
|
+
` ff_code=$?`,
|
|
35894
|
+
` if [ "$ff_code" -ne 0 ]; then ${doneLine(install, false, "$ff_code")}; else`,
|
|
35895
|
+
" (",
|
|
35896
|
+
" set -e",
|
|
35897
|
+
...writeRecord(repo).map((l) => ` ${l}`),
|
|
35898
|
+
" )",
|
|
35899
|
+
` ff_code=$?`,
|
|
35900
|
+
` if [ "$ff_code" -ne 0 ]; then echo "could not write the install record"; ${doneLine(install, false, "$ff_code")}; else ${doneLine(install, true)}; fi`,
|
|
35901
|
+
" fi",
|
|
35902
|
+
"fi"
|
|
35903
|
+
])
|
|
35905
35904
|
];
|
|
35906
35905
|
};
|
|
35907
35906
|
const applyStdin = (token, config, schema) => [
|
|
@@ -37489,8 +37488,8 @@ const exitAlternativeScreen = "\x1B[?1049l";
|
|
|
37489
37488
|
//#endregion
|
|
37490
37489
|
//#region ../../node_modules/.pnpm/is-in-ci@2.0.0/node_modules/is-in-ci/index.js
|
|
37491
37490
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
37492
|
-
const check = (key) => key in env && env[key] !== "0" && env[key] !== "false";
|
|
37493
|
-
const isInCi = check("CI") || check("CONTINUOUS_INTEGRATION");
|
|
37491
|
+
const check$1 = (key) => key in env && env[key] !== "0" && env[key] !== "false";
|
|
37492
|
+
const isInCi = check$1("CI") || check$1("CONTINUOUS_INTEGRATION");
|
|
37494
37493
|
//#endregion
|
|
37495
37494
|
//#region ../../node_modules/.pnpm/auto-bind@5.0.1/node_modules/auto-bind/index.js
|
|
37496
37495
|
const getAllProperties = (object) => {
|
|
@@ -64260,8 +64259,7 @@ const LedgerState = Struct({
|
|
|
64260
64259
|
ended: optionalKey(Number$2)
|
|
64261
64260
|
});
|
|
64262
64261
|
const short = (sha) => sha === void 0 ? void 0 : sha.slice(0, 7);
|
|
64263
|
-
const
|
|
64264
|
-
const doingOf = (id) => id === "config" ? "copying" : id.endsWith(FETCH) ? "fetching" : "installing";
|
|
64262
|
+
const doingOf = (id) => id === "config" ? "copying" : isFetchStep(id) ? "fetching" : "installing";
|
|
64265
64263
|
const itemsOf = (p, state) => {
|
|
64266
64264
|
const items = /* @__PURE__ */ new Map();
|
|
64267
64265
|
const key = (kind, name) => `${kind}:${name}`;
|
|
@@ -64343,15 +64341,7 @@ const itemsOf = (p, state) => {
|
|
|
64343
64341
|
return [...items.values()];
|
|
64344
64342
|
};
|
|
64345
64343
|
const outcomeOf = (m, dryRun) => m.status === "skipped" ? "skipped" : m.status === "failed" || m.items.some((i) => i.status === "failed") ? "failed" : m.status === "ok" || m.status === "planned" && dryRun ? "ok" : void 0;
|
|
64346
|
-
const
|
|
64347
|
-
const outcomes = state.machines.map((m) => outcomeOf(m, state.dryRun));
|
|
64348
|
-
const n = (o) => outcomes.filter((x) => x === o).length;
|
|
64349
|
-
return {
|
|
64350
|
-
ok: n("ok"),
|
|
64351
|
-
skipped: n("skipped"),
|
|
64352
|
-
failed: n("failed")
|
|
64353
|
-
};
|
|
64354
|
-
};
|
|
64344
|
+
const anyFailed = (state) => state.machines.some((m) => outcomeOf(m, state.dryRun) === "failed");
|
|
64355
64345
|
const makeLedger = fn("makeLedger")(function* (input) {
|
|
64356
64346
|
const started = yield* currentTimeMillis;
|
|
64357
64347
|
let snapshot = {
|
|
@@ -64436,7 +64426,7 @@ const makeLedger = fn("makeLedger")(function* (input) {
|
|
|
64436
64426
|
})),
|
|
64437
64427
|
stepStarted: (name, id) => items(name, id, (item, now) => item.status === "failed" ? item : {
|
|
64438
64428
|
...item,
|
|
64439
|
-
changes: item.changes || !(id === "config" || id
|
|
64429
|
+
changes: item.changes || !(id === "config" || isFetchStep(id)),
|
|
64440
64430
|
status: "running",
|
|
64441
64431
|
doing: doingOf(id),
|
|
64442
64432
|
started: item.started ?? now
|
|
@@ -64452,7 +64442,7 @@ const makeLedger = fn("makeLedger")(function* (input) {
|
|
|
64452
64442
|
ended: now
|
|
64453
64443
|
};
|
|
64454
64444
|
const { doing: _, ...rest } = item;
|
|
64455
|
-
if (id
|
|
64445
|
+
if (isFetchStep(id)) return item.changes ? item : {
|
|
64456
64446
|
...rest,
|
|
64457
64447
|
status: "idle",
|
|
64458
64448
|
ended: now
|
|
@@ -64908,10 +64898,38 @@ const summaryOf = (m, dryRun) => {
|
|
|
64908
64898
|
text: `${skipped} skipped`,
|
|
64909
64899
|
tone: "skip"
|
|
64910
64900
|
});
|
|
64911
|
-
return parts
|
|
64912
|
-
|
|
64901
|
+
return joined(parts);
|
|
64902
|
+
};
|
|
64903
|
+
const joined = (parts) => parts.flatMap((part, n) => n === 0 ? [part] : [{
|
|
64904
|
+
text: ", ",
|
|
64905
|
+
tone: "dim"
|
|
64906
|
+
}, part]);
|
|
64907
|
+
const shipSummary = (state) => {
|
|
64908
|
+
const outcomes = state.machines.map((m) => {
|
|
64909
|
+
const outcome = outcomeOf(m, state.dryRun);
|
|
64910
|
+
if (outcome !== "ok") return outcome;
|
|
64911
|
+
const { changes, skipped } = countsOf(m);
|
|
64912
|
+
if (changes > 0) return state.dryRun ? "to change" : "updated";
|
|
64913
|
+
return skipped > 0 ? "skipped" : "up to date";
|
|
64914
|
+
});
|
|
64915
|
+
const counted = (outcome, tone) => {
|
|
64916
|
+
const n = outcomes.filter((o) => o === outcome).length;
|
|
64917
|
+
return n === 0 ? [] : [{
|
|
64918
|
+
text: `${n} ${outcome}`,
|
|
64919
|
+
tone
|
|
64920
|
+
}];
|
|
64921
|
+
};
|
|
64922
|
+
const parts = joined([
|
|
64923
|
+
...counted("updated", "ok"),
|
|
64924
|
+
...counted("to change", "dim"),
|
|
64925
|
+
...counted("up to date", "ok"),
|
|
64926
|
+
...counted("failed", "fail"),
|
|
64927
|
+
...counted("skipped", "skip")
|
|
64928
|
+
]);
|
|
64929
|
+
return parts.length === 0 ? [{
|
|
64930
|
+
text: "nothing changed",
|
|
64913
64931
|
tone: "dim"
|
|
64914
|
-
}
|
|
64932
|
+
}] : parts;
|
|
64915
64933
|
};
|
|
64916
64934
|
const elapsed = (started, ended, now) => started === void 0 ? "" : duration((ended ?? now) - started);
|
|
64917
64935
|
const Parts = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Line, { children: props.parts.map((part, n) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(T, {
|
|
@@ -65067,7 +65085,6 @@ const LedgerView = (props) => {
|
|
|
65067
65085
|
const shown = lines.length <= room ? lines : lines.slice(0, Math.max(0, room - 1));
|
|
65068
65086
|
const hidden = count(blocks) - (shown.length - cuts);
|
|
65069
65087
|
if (room < 1) return null;
|
|
65070
|
-
const t = tally(state);
|
|
65071
65088
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
65072
65089
|
flexDirection: "column",
|
|
65073
65090
|
marginTop: 1,
|
|
@@ -65079,26 +65096,10 @@ const LedgerView = (props) => {
|
|
|
65079
65096
|
}),
|
|
65080
65097
|
state.ended !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
65081
65098
|
marginTop: 1,
|
|
65082
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Parts, { parts: [
|
|
65083
|
-
{
|
|
65084
|
-
|
|
65085
|
-
|
|
65086
|
-
},
|
|
65087
|
-
{ text: " " },
|
|
65088
|
-
{
|
|
65089
|
-
text: `skipped ${t.skipped}`,
|
|
65090
|
-
...t.skipped > 0 ? { tone: "skip" } : {}
|
|
65091
|
-
},
|
|
65092
|
-
{ text: " " },
|
|
65093
|
-
{
|
|
65094
|
-
text: `failed ${t.failed}`,
|
|
65095
|
-
...t.failed > 0 ? { tone: "fail" } : {}
|
|
65096
|
-
},
|
|
65097
|
-
...dryRun ? [] : [{
|
|
65098
|
-
text: ` in ${duration(state.ended - state.started)}`,
|
|
65099
|
-
tone: "dim"
|
|
65100
|
-
}]
|
|
65101
|
-
] })
|
|
65099
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Parts, { parts: [...shipSummary(state), ...dryRun ? [] : [{
|
|
65100
|
+
text: ` in ${duration(state.ended - state.started)}`,
|
|
65101
|
+
tone: "dim"
|
|
65102
|
+
}]] })
|
|
65102
65103
|
}),
|
|
65103
65104
|
state.ended !== void 0 && props.hint !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Line, {
|
|
65104
65105
|
tone: "dim",
|
|
@@ -65287,16 +65288,16 @@ const runOn = fn("runOn")(function* (target, script, secrets, onLine, ledger) {
|
|
|
65287
65288
|
}
|
|
65288
65289
|
return run;
|
|
65289
65290
|
});
|
|
65290
|
-
const
|
|
65291
|
-
const
|
|
65291
|
+
const CHECK_TIMEOUT = "2 minutes";
|
|
65292
|
+
const check = fn("check")(function* (target, script, ledger) {
|
|
65292
65293
|
const facts = [];
|
|
65293
65294
|
const output = [];
|
|
65294
65295
|
const run = yield* runOn(target, script, [], (line) => sync(() => {
|
|
65295
65296
|
if (line.kind === "state") facts.push(line.fact);
|
|
65296
65297
|
else if (line.kind === "text" && line.text.trim() !== "") output.push(line.text.trimEnd());
|
|
65297
65298
|
}), ledger).pipe(timeoutOrElse({
|
|
65298
|
-
duration:
|
|
65299
|
-
orElse: () => ledger.fail(target.name, [`checking took more than ${
|
|
65299
|
+
duration: CHECK_TIMEOUT,
|
|
65300
|
+
orElse: () => ledger.fail(target.name, [`checking took more than ${CHECK_TIMEOUT}; something on that Machine is blocking`, ...output]).pipe(as({ kind: "failed" }))
|
|
65300
65301
|
}));
|
|
65301
65302
|
if (run.kind !== "ran") return { kind: run.kind };
|
|
65302
65303
|
const state = assembleState(facts);
|
|
@@ -65305,7 +65306,7 @@ const gather = fn("gather")(function* (target, script, ledger) {
|
|
|
65305
65306
|
return { kind: "failed" };
|
|
65306
65307
|
}
|
|
65307
65308
|
return {
|
|
65308
|
-
kind: "
|
|
65309
|
+
kind: "checked",
|
|
65309
65310
|
state
|
|
65310
65311
|
};
|
|
65311
65312
|
});
|
|
@@ -65389,7 +65390,7 @@ const askQuestions = fn("askQuestions")(function* (questions, flags, ledger, ask
|
|
|
65389
65390
|
value: bump
|
|
65390
65391
|
},
|
|
65391
65392
|
{
|
|
65392
|
-
title: "skip on these Machines (leave as is,
|
|
65393
|
+
title: "skip on these Machines (leave as is, shown as skipped)",
|
|
65393
65394
|
value: { kind: "skip" }
|
|
65394
65395
|
},
|
|
65395
65396
|
{
|
|
@@ -65427,19 +65428,18 @@ const packagesToResolve = (config) => {
|
|
|
65427
65428
|
];
|
|
65428
65429
|
};
|
|
65429
65430
|
const rebuildOf = (flags) => flags.rebuild.length === 0 ? "none" : flags.rebuild.includes("all") ? "all" : flags.rebuild;
|
|
65430
|
-
const staleConfigs = fn("staleConfigs")(function* (
|
|
65431
|
-
const
|
|
65432
|
-
for (const { machine,
|
|
65433
|
-
if (
|
|
65431
|
+
const staleConfigs = fn("staleConfigs")(function* (config, own, checked, ledger) {
|
|
65432
|
+
const copies = [];
|
|
65433
|
+
for (const { machine, state } of checked) {
|
|
65434
|
+
if (state.config === void 0) continue;
|
|
65434
65435
|
const parsed = yield* result(parseConfig(machine.name, state.config));
|
|
65435
|
-
if (parsed._tag === "Failure") {
|
|
65436
|
-
|
|
65437
|
-
|
|
65438
|
-
|
|
65439
|
-
|
|
65440
|
-
if (isNewer(remote.shippedTo?.[machine.name], local.shippedTo?.[machine.name])) stale.push(`${machine.name} (shipped ${remote.shippedAt} from ${remote.shippedFrom ?? "unknown"})`);
|
|
65436
|
+
if (parsed._tag === "Failure") yield* ledger.note("info", `the config on ${machine.name} does not parse; it will be overwritten`);
|
|
65437
|
+
else copies.push({
|
|
65438
|
+
machine: machine.name,
|
|
65439
|
+
config: parsed.success
|
|
65440
|
+
});
|
|
65441
65441
|
}
|
|
65442
|
-
return
|
|
65442
|
+
return staleCopies(config, copies, own).map((c) => `${c.machine} (shipped ${c.config.shippedAt} from ${c.config.shippedFrom ?? "unknown"})`);
|
|
65443
65443
|
});
|
|
65444
65444
|
const schemaJson = encodeSync(fromJsonString(Unknown, { space: 2 }));
|
|
65445
65445
|
const ship = fn("ship")(function* (flags) {
|
|
@@ -65450,6 +65450,7 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65450
65450
|
const unknown = unknownMachines(config, tailnet, flags.only);
|
|
65451
65451
|
if (unknown.length > 0) return yield* fail$1(new ShipError(`unknown Machine: ${unknown.join(", ")} (the tailnet has: ${tailnet.fleet.map((m) => m.name).join(", ")})`));
|
|
65452
65452
|
const fleet = new Set(Object.keys(config.machines));
|
|
65453
|
+
const own = flags.config === void 0 ? tailnet.self.name : void 0;
|
|
65453
65454
|
if (!fleet.has(tailnet.self.name)) return yield* fail$1(new ShipError(`this Machine (${tailnet.self.name}) is not in machines in ${path}`));
|
|
65454
65455
|
const outsideFleet = flags.only.filter((name) => !fleet.has(name));
|
|
65455
65456
|
if (outsideFleet.length > 0) return yield* fail$1(new ShipError(`not in machines in ${path}: ${outsideFleet.join(", ")}`));
|
|
@@ -65477,16 +65478,16 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65477
65478
|
full: true,
|
|
65478
65479
|
now: state.ended ?? 0
|
|
65479
65480
|
}, color));
|
|
65480
|
-
if (
|
|
65481
|
+
if (anyFailed(state)) process.exitCode = 1;
|
|
65481
65482
|
});
|
|
65482
65483
|
yield* addFinalizer(() => finish());
|
|
65483
65484
|
const live = redraw ? yield* startLive(store, color) : noLive;
|
|
65484
65485
|
const cloneRootOf = (machine) => config.machines[machine.name]?.clones ?? "~/.local/share/fleetfizz/clones";
|
|
65485
|
-
const
|
|
65486
|
+
const checkRepos = (config.repos ?? []).map((r) => ({
|
|
65486
65487
|
name: repoName(r),
|
|
65487
65488
|
outputs: r.outputs ?? []
|
|
65488
65489
|
}));
|
|
65489
|
-
const
|
|
65490
|
+
const checked = yield* forEach$1(targetsList, fn("checkOne")(function* (machine) {
|
|
65490
65491
|
const local = machine.name === tailnet.self.name;
|
|
65491
65492
|
if (!machine.online) {
|
|
65492
65493
|
yield* ledger.skip(machine.name, "offline");
|
|
@@ -65496,15 +65497,15 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65496
65497
|
yield* ledger.skip(machine.name, "no Tailscale SSH server");
|
|
65497
65498
|
return;
|
|
65498
65499
|
}
|
|
65499
|
-
const script =
|
|
65500
|
+
const script = checkScript({
|
|
65500
65501
|
cloneRoot: cloneRootOf(machine),
|
|
65501
|
-
repos:
|
|
65502
|
+
repos: checkRepos
|
|
65502
65503
|
});
|
|
65503
|
-
const result = yield*
|
|
65504
|
+
const result = yield* check({
|
|
65504
65505
|
name: machine.name,
|
|
65505
65506
|
local
|
|
65506
65507
|
}, script, ledger);
|
|
65507
|
-
if (result.kind !== "
|
|
65508
|
+
if (result.kind !== "checked") return void 0;
|
|
65508
65509
|
yield* ledger.checked(machine.name);
|
|
65509
65510
|
return {
|
|
65510
65511
|
machine,
|
|
@@ -65512,7 +65513,7 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65512
65513
|
state: result.state
|
|
65513
65514
|
};
|
|
65514
65515
|
}), { concurrency: "unbounded" }).pipe(map$5((list) => list.filter((g) => g !== void 0)));
|
|
65515
|
-
const stale = yield* staleConfigs(config,
|
|
65516
|
+
const stale = yield* staleConfigs(config, own, checked, ledger);
|
|
65516
65517
|
if (stale.length > 0) {
|
|
65517
65518
|
const what = `newer config on ${stale.join(", ")}`;
|
|
65518
65519
|
if (flags.dryRun) yield* ledger.note("info", `${what}; a Ship would ask before overwriting it`);
|
|
@@ -65532,7 +65533,7 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65532
65533
|
}
|
|
65533
65534
|
}
|
|
65534
65535
|
const versions = yield* resolveVersions(packagesToResolve(config));
|
|
65535
|
-
const planAll = (cfg, answers) =>
|
|
65536
|
+
const planAll = (cfg, answers) => checked.map((g) => ({
|
|
65536
65537
|
...g,
|
|
65537
65538
|
plan: plan({
|
|
65538
65539
|
config: cfg,
|
|
@@ -65573,7 +65574,8 @@ const ship = fn("ship")(function* (flags) {
|
|
|
65573
65574
|
const stampWith = (reached) => stampText(original, {
|
|
65574
65575
|
shippedAt,
|
|
65575
65576
|
shippedFrom: tailnet.self.name,
|
|
65576
|
-
reached
|
|
65577
|
+
reached,
|
|
65578
|
+
own
|
|
65577
65579
|
});
|
|
65578
65580
|
const stamped = stampWith(planned.map((g) => g.machine.name));
|
|
65579
65581
|
yield* fs.writeFileString(path, stamped);
|