Merge remote-tracking branch 'origin/main' into setup-feedback-fixes

# Conflicts:
#	setup/auto.ts
#	setup/channels/whatsapp.ts
This commit is contained in:
gavrielc
2026-04-23 10:39:35 +03:00
17 changed files with 167 additions and 49 deletions

View File

@@ -34,6 +34,7 @@ import k from 'kleur';
import * as setupLog from '../logs.js';
import { brightSelect } from '../lib/bright-select.js';
import { getLaunchdLabel, getSystemdUnit } from '../../src/install-slug.js';
import {
type Block,
type StepResult,
@@ -359,17 +360,18 @@ async function restartService(): Promise<void> {
if (platform === 'darwin') {
spawnSync(
'launchctl',
['kickstart', '-k', `gui/${process.getuid?.() ?? 501}/com.nanoclaw`],
['kickstart', '-k', `gui/${process.getuid?.() ?? 501}/${getLaunchdLabel()}`],
{ stdio: 'ignore' },
);
} else if (platform === 'linux') {
const unit = getSystemdUnit();
const user = spawnSync(
'systemctl',
['--user', 'restart', 'nanoclaw'],
['--user', 'restart', unit],
{ stdio: 'ignore' },
);
if (user.status !== 0) {
spawnSync('sudo', ['systemctl', 'restart', 'nanoclaw'], {
spawnSync('sudo', ['systemctl', 'restart', unit], {
stdio: 'ignore',
});
}