@masslessai/push-todo 4.2.2 → 4.2.3
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/lib/launchagent.js +9 -9
- package/package.json +1 -1
package/lib/launchagent.js
CHANGED
|
@@ -103,13 +103,13 @@ export function getStatus() {
|
|
|
103
103
|
|
|
104
104
|
if (installed) {
|
|
105
105
|
try {
|
|
106
|
-
|
|
107
|
-
encoding: 'utf8',
|
|
106
|
+
execFileSync('launchctl', ['list', LABEL], {
|
|
108
107
|
timeout: 5000,
|
|
108
|
+
stdio: ['ignore', 'pipe', 'ignore'], // capture stdout, suppress stderr
|
|
109
109
|
});
|
|
110
|
-
loaded =
|
|
110
|
+
loaded = true; // If no error thrown, service exists
|
|
111
111
|
} catch {
|
|
112
|
-
loaded = false;
|
|
112
|
+
loaded = false; // launchctl exits non-zero if service not found
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -135,11 +135,11 @@ export function install() {
|
|
|
135
135
|
if (existsSync(PLIST_PATH)) {
|
|
136
136
|
const existing = readFileSync(PLIST_PATH, 'utf8');
|
|
137
137
|
if (existing === newContent) {
|
|
138
|
-
// Ensure loaded
|
|
138
|
+
// Ensure loaded (suppress stderr — already-loaded plist emits noise)
|
|
139
139
|
try {
|
|
140
140
|
execFileSync('launchctl', ['load', '-w', PLIST_PATH], {
|
|
141
|
-
encoding: 'utf8',
|
|
142
141
|
timeout: 5000,
|
|
142
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
143
143
|
});
|
|
144
144
|
} catch {}
|
|
145
145
|
return { success: true, message: 'LaunchAgent already installed', alreadyInstalled: true };
|
|
@@ -148,8 +148,8 @@ export function install() {
|
|
|
148
148
|
// Content changed (e.g., node path updated) — unload old, write new
|
|
149
149
|
try {
|
|
150
150
|
execFileSync('launchctl', ['unload', PLIST_PATH], {
|
|
151
|
-
encoding: 'utf8',
|
|
152
151
|
timeout: 5000,
|
|
152
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
153
153
|
});
|
|
154
154
|
} catch {}
|
|
155
155
|
}
|
|
@@ -159,8 +159,8 @@ export function install() {
|
|
|
159
159
|
|
|
160
160
|
// Load it
|
|
161
161
|
execFileSync('launchctl', ['load', '-w', PLIST_PATH], {
|
|
162
|
-
encoding: 'utf8',
|
|
163
162
|
timeout: 5000,
|
|
163
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
return { success: true, message: 'LaunchAgent installed and loaded' };
|
|
@@ -183,8 +183,8 @@ export function uninstall() {
|
|
|
183
183
|
// Unload
|
|
184
184
|
try {
|
|
185
185
|
execFileSync('launchctl', ['unload', PLIST_PATH], {
|
|
186
|
-
encoding: 'utf8',
|
|
187
186
|
timeout: 5000,
|
|
187
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
188
188
|
});
|
|
189
189
|
} catch {}
|
|
190
190
|
|