shennian 0.2.83 → 0.2.84
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.
|
@@ -51,6 +51,7 @@ export declare function clearDaemonPidIfOwner(pid: number, instanceId: string):
|
|
|
51
51
|
export declare function writeDaemonLauncher(pid: number, launcher?: DaemonLauncher, instanceId?: string): void;
|
|
52
52
|
export declare function clearDaemonLauncher(instanceId?: string): void;
|
|
53
53
|
export declare function recordStartedDaemon(childPid: number | undefined): void;
|
|
54
|
+
export declare function isShennianRunServiceCommand(command: string): boolean;
|
|
54
55
|
export declare function findRunningDaemonProcessIds(excludePid?: number): number[];
|
|
55
56
|
export declare function getDaemonStatus(opts?: {
|
|
56
57
|
cleanupStale?: boolean;
|
|
@@ -248,13 +248,11 @@ function inferDaemonLauncherFromProcess(pid) {
|
|
|
248
248
|
}
|
|
249
249
|
return 'unknown';
|
|
250
250
|
}
|
|
251
|
-
function isShennianRunServiceCommand(command) {
|
|
252
|
-
const normalized = command.replace(/\\/g, '/');
|
|
253
|
-
return (
|
|
254
|
-
(
|
|
255
|
-
|
|
256
|
-
normalized.includes(' shennian run-service') ||
|
|
257
|
-
normalized.includes(' shennian.js run-service')));
|
|
251
|
+
export function isShennianRunServiceCommand(command) {
|
|
252
|
+
const normalized = command.replace(/\\/g, '/').trim();
|
|
253
|
+
return (/^(?:\S*\/)?node\s+\S*(?:\/node_modules\/shennian\/|\/dist\/bin\/shennian\.js)\s+run-service(?:\s|$)/.test(normalized) ||
|
|
254
|
+
/^(?:\S*\/)?shennian(?:\.cmd)?\s+run-service(?:\s|$)/.test(normalized) ||
|
|
255
|
+
/^(?:\S*\/)?npx(?:\.cmd)?\s+(?:--yes\s+)?shennian\s+run-service(?:\s|$)/.test(normalized));
|
|
258
256
|
}
|
|
259
257
|
export function findRunningDaemonProcessIds(excludePid = process.pid) {
|
|
260
258
|
if (getPlatform() === 'win32')
|