Lines 2388-2428javascript
2389 const info = refreshClientServiceUnitForUpdate();
2390 print.line(` refresh-unit: ${info.platform} unit rewritten at ${info.unitPath}\n`);
2392 const msg = err instanceof Error ? err.message : String(err);
2393 print.line(` refresh-unit: failed to rewrite service unit: ${msg}\n`);
2399//#region src/commands/daemon/restart.ts
2400function registerDaemonRestartCommand(daemon) {
2401 daemon.command("restart").description("Restart the background service").action(() => {
2402 if (!isServiceSupported()) {
2403 if (process.platform === "win32") {
2404 print.line("\n Service control is not supported on Windows.\n");
2405 print.line(" First Tree runs inline on this platform.\n\n");
2406 print.line(" If you are onboarding and need to refresh detected agents:\n");
2407 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2408 print.line(" If you need to restart the inline daemon:\n");
2409 print.line(` stop the PowerShell running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2410 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2412 print.line(`\n Service control is not supported on ${process.platform}.\n`);
2413 print.line(" First Tree runs inline on this platform.\n\n");
2414 print.line(" If you are onboarding and need to refresh detected agents:\n");
2415 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2416 print.line(" If you need to restart the inline daemon:\n");
2417 print.line(` stop the terminal running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2418 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2422 if (getClientServiceStatus().state === "not-installed") {
2423 print.line("\n No background service installed.\n");
2424 print.line(` Run \`${channelConfig.binName} login <token>\` first.\n\n`);
2427 const res = restartClientService();