@jamiexiongr/panda-hub 0.1.21 → 0.1.22
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.
|
@@ -15,7 +15,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
|
|
|
15
15
|
// release/panda-hub/package.json
|
|
16
16
|
var package_default = {
|
|
17
17
|
name: "@jamiexiongr/panda-hub",
|
|
18
|
-
version: "0.1.
|
|
18
|
+
version: "0.1.22",
|
|
19
19
|
type: "module",
|
|
20
20
|
private: false,
|
|
21
21
|
description: "Panda hub runtime",
|
|
@@ -150,6 +150,15 @@ var waitForWindowsServiceState = async (input, desiredState, timeoutMs = WINDOWS
|
|
|
150
150
|
}
|
|
151
151
|
return latest;
|
|
152
152
|
};
|
|
153
|
+
var waitForWindowsServicePresence = async (input, timeoutMs = WINDOWS_SERVICE_TIMEOUT_MS) => {
|
|
154
|
+
const startedAt = Date.now();
|
|
155
|
+
let latest = queryWindowsServiceStatus(input);
|
|
156
|
+
while (!latest.exists && Date.now() - startedAt < timeoutMs) {
|
|
157
|
+
await wait(750);
|
|
158
|
+
latest = queryWindowsServiceStatus(input);
|
|
159
|
+
}
|
|
160
|
+
return latest;
|
|
161
|
+
};
|
|
153
162
|
var startWindowsService = async (input) => {
|
|
154
163
|
ensureWindows();
|
|
155
164
|
const current = queryWindowsServiceStatus(input);
|
|
@@ -275,7 +284,11 @@ var installOrUpdateWindowsService = async (definition, options) => {
|
|
|
275
284
|
}
|
|
276
285
|
const service = createNodeWindowsService(definition);
|
|
277
286
|
await waitForNodeWindowsAction(service, "install");
|
|
278
|
-
|
|
287
|
+
const installed = await waitForWindowsServicePresence(definition);
|
|
288
|
+
if (!installed.exists) {
|
|
289
|
+
throw new Error(`Windows \u670D\u52A1 ${reference.displayName} \u6CE8\u518C\u540E\u4ECD\u4E0D\u53EF\u89C1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`);
|
|
290
|
+
}
|
|
291
|
+
runSc(["config", quoteForSc(installed.controllerName), "start=", "auto"]);
|
|
279
292
|
let started = false;
|
|
280
293
|
let startError = null;
|
|
281
294
|
if (options?.start !== false) {
|
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED