INNER CODE UNIT · TypeScript
started
lidge-jun/opencodex · src/cli/index.ts:1008
const started = await handleEnsure({ existingIsSuccess: false, forceStart: recoveringLiveRestart, onSpawn: spawned => { child = spawned; } });
return restartStartOutcome(started, child);
} catch (error) {
return restartStartOutcome(false, child, error);
}
}
async function handleStop(approval?: StopApproval) {
const lease = acquireOwnershipMutationLease(serviceStatePaths());
try {
if (!approval) return await handleStopUnlocked();
return await runApprovedStop(
approval,
async () => {
const lines: string[] = [];
const code = await runResolve({ json: true }, {
stdout: { log: line => { lines.push(line); } },
stderr: { error: () => {} },
});