import type { RuntimeEnv } from "../runtime.js"; import { defaultRuntime } from "../runtime.js"; import { restoreTerminalState } from "../terminal/restore.js"; import { createClackPrompter } from "../wizard/clack-prompter.js"; import { WizardCancelledError } from "../wizard/prompts.js"; import { runSetupWizard } from "../wizard/setup.js"; import type { OnboardOptions } from "./onboard-types.js";
export async function runInteractiveSetup(
opts: OnboardOptions,
runtime: RuntimeEnv = defaultRuntime,
) { const prompter = createClackPrompter();
let exitCode: number | null = null; try {
await runSetupWizard(opts, runtime, prompter);
} catch (err) { if (err instanceof WizardCancelledError) { // Best practice: cancellation is not a successful completion.
exitCode = 1; return;
} throw err;
} finally { // Keep stdin paused so non-daemon runs can exit cleanly (e.g. Docker setup).
restoreTerminalState("setup finish", { resumeStdinIfPaused: false }); if (exitCode !== null) {
runtime.exit(exitCode);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.