@ctrl-spc/cli 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/dist/launchd.js +11 -1
  2. package/package.json +1 -1
package/dist/launchd.js CHANGED
@@ -77,6 +77,9 @@ export function bootoutArgs(uid, plistPath) {
77
77
  export function kickstartArgs(uid) {
78
78
  return ['kickstart', '-k', `gui/${uid}/${PLIST_LABEL}`];
79
79
  }
80
+ export function bootstrapArgs(uid, plistPath) {
81
+ return ['bootstrap', `gui/${uid}`, plistPath];
82
+ }
80
83
  export async function stopDaemon(home = homedir(), exec = defaultExec) {
81
84
  const uid = process.getuid?.();
82
85
  if (uid === undefined)
@@ -92,11 +95,18 @@ export async function restartDaemon(home = homedir(), exec = defaultExec) {
92
95
  const uid = process.getuid?.();
93
96
  if (uid === undefined)
94
97
  throw new Error(RESTART_FAILED_MESSAGE);
98
+ const plistPath = getPlistPath(home);
95
99
  try {
96
100
  exec('launchctl', kickstartArgs(uid));
97
101
  }
98
102
  catch {
99
- throw new Error(RESTART_FAILED_MESSAGE);
103
+ try {
104
+ exec('launchctl', bootstrapArgs(uid, plistPath));
105
+ exec('launchctl', kickstartArgs(uid));
106
+ }
107
+ catch {
108
+ throw new Error(RESTART_FAILED_MESSAGE);
109
+ }
100
110
  }
101
111
  }
102
112
  function escapeXml(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctrl-spc/cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Control Space CLI - machine setup and background daemon",
5
5
  "type": "module",
6
6
  "files": [