@geminilight/mindos 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +8 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -354,15 +354,16 @@ const launchd = {
|
|
|
354
354
|
`;
|
|
355
355
|
writeFileSync(LAUNCHD_PLIST, plist, 'utf-8');
|
|
356
356
|
console.log(green(`✔ Wrote ${LAUNCHD_PLIST}`));
|
|
357
|
+
// Bootout first to ensure the new plist (with updated PATH) takes effect.
|
|
358
|
+
// Safe to ignore errors here — service may not be loaded yet.
|
|
359
|
+
try { execSync(`launchctl bootout gui/${launchctlUid()}/${LAUNCHD_LABEL}`, { stdio: 'pipe' }); } catch {}
|
|
357
360
|
try {
|
|
358
361
|
execSync(`launchctl bootstrap gui/${launchctlUid()} ${LAUNCHD_PLIST}`, { stdio: 'pipe' });
|
|
359
362
|
} catch (e) {
|
|
360
|
-
const msg = e.stderr?.toString() ?? e.message ?? '';
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
console.error(dim(' If this persists, try: launchctl bootout gui/$(id -u)/com.mindos.app'));
|
|
365
|
-
}
|
|
363
|
+
const msg = (e.stderr?.toString() ?? e.message ?? '').trim();
|
|
364
|
+
console.error(red(`\n✘ launchctl bootstrap failed: ${msg}`));
|
|
365
|
+
console.error(dim(' Try running: launchctl bootout gui/$(id -u)/com.mindos.app then retry.\n'));
|
|
366
|
+
process.exit(1);
|
|
366
367
|
}
|
|
367
368
|
console.log(green('✔ Service installed'));
|
|
368
369
|
},
|
|
@@ -839,6 +840,7 @@ ${dim('Shortcut: mindos start --daemon → install + start in one step')}
|
|
|
839
840
|
if (daemonRunning) {
|
|
840
841
|
console.log(cyan('\n Daemon is running — restarting to apply the new version...'));
|
|
841
842
|
await runGatewayCommand('stop');
|
|
843
|
+
await runGatewayCommand('install'); // regenerate plist/unit with updated PATH and binary
|
|
842
844
|
await runGatewayCommand('start');
|
|
843
845
|
const webPort = process.env.MINDOS_WEB_PORT || '3000';
|
|
844
846
|
console.log(dim(' (Waiting for Web UI to come back up...)'));
|
package/package.json
CHANGED