Merge remote-tracking branch 'origin/main' into setup-feedback-fixes
# Conflicts: # setup/auto.ts # setup/channels/whatsapp.ts
This commit is contained in:
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user