feat: add dry-run server cleanup plan
This commit is contained in:
@@ -22,6 +22,7 @@ import { runAuthBrokerCommand } from "./src/auth-broker";
|
||||
import { runGhCommand } from "./src/gh";
|
||||
import { runCommanderCommand } from "./src/commander";
|
||||
import { isHelpToken, rootHelp, serverHelp, sshHelp, staticNamespaceHelp } from "./src/help";
|
||||
import { runServerCleanupCommand } from "./src/server-cleanup";
|
||||
|
||||
const remoteOptions = extractRemoteCliOptions(process.argv.slice(2));
|
||||
const args = remoteOptions.args;
|
||||
@@ -269,6 +270,13 @@ async function main(): Promise<void> {
|
||||
emitJson(commandName, stackLogs(config, boundedNumberOption("--tail-bytes", 3000, 500_000)));
|
||||
return;
|
||||
}
|
||||
if (sub === "cleanup") {
|
||||
const result = await runServerCleanupCommand(config, args.slice(2));
|
||||
const ok = (result as { ok?: unknown }).ok !== false;
|
||||
emitJson(commandName, result, ok);
|
||||
if (!ok) process.exitCode = 1;
|
||||
return;
|
||||
}
|
||||
if (sub === "rebuild") {
|
||||
if (!isRebuildableService(third)) {
|
||||
const result = unsupportedRebuildService(third);
|
||||
|
||||
Reference in New Issue
Block a user