@fickydev/pigent 0.1.2 → 0.1.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/package.json +1 -1
- package/src/cli/run.ts +8 -5
package/package.json
CHANGED
package/src/cli/run.ts
CHANGED
|
@@ -242,11 +242,14 @@ async function showLogs(): Promise<void> {
|
|
|
242
242
|
|
|
243
243
|
async function systemctl(action: string, nothrow = false, extra?: string): Promise<void> {
|
|
244
244
|
const commandArgs = extra ? [action, extra] : [action, `${serviceName}.service`];
|
|
245
|
-
const proc =
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
245
|
+
const proc = Bun.spawn(["systemctl", "--user", ...commandArgs], {
|
|
246
|
+
stdout: "inherit",
|
|
247
|
+
stderr: "inherit",
|
|
248
|
+
});
|
|
249
|
+
const exitCode = await proc.exited;
|
|
250
|
+
|
|
251
|
+
if (exitCode !== 0 && !nothrow) {
|
|
252
|
+
throw new Error(`systemctl ${commandArgs.join(" ")} failed with exit code ${exitCode}`);
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
|