mioku 1.2.1 → 1.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/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{exec-CBlGXt5y.js → exec-BPj3FRdI.js} +2 -2
- package/dist/{exec-CBlGXt5y.js.map → exec-BPj3FRdI.js.map} +1 -1
- package/dist/{exec-B2fmdRh2.cjs → exec-CniJOLOF.cjs} +2 -2
- package/dist/{exec-B2fmdRh2.cjs.map → exec-CniJOLOF.cjs.map} +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildSpawnPlan, commandExists, compareVersions, pickHighestVersion, resolveCommand, runCommand, runCommandInherit, version } from "./exec-
|
|
1
|
+
import { buildSpawnPlan, commandExists, compareVersions, pickHighestVersion, resolveCommand, runCommand, runCommandInherit, version } from "./exec-BPj3FRdI.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import * as fs$5 from "node:fs";
|
|
4
4
|
import * as fs$4 from "node:fs";
|
|
@@ -450,7 +450,7 @@ var MessageImpl = class extends Array {
|
|
|
450
450
|
return this.map((seg) => seg.toString()).join("");
|
|
451
451
|
}
|
|
452
452
|
text() {
|
|
453
|
-
return this.
|
|
453
|
+
return this.filterByType("text").map((seg) => String(seg.data.text ?? "")).join("");
|
|
454
454
|
}
|
|
455
455
|
filterByType(type) {
|
|
456
456
|
return this.filter((seg) => seg.type === type);
|
|
@@ -4112,6 +4112,11 @@ function ensureDataDir(pluginName) {
|
|
|
4112
4112
|
//#endregion
|
|
4113
4113
|
//#region src/builtin/core/system/restart.ts
|
|
4114
4114
|
const isInPm2 = Boolean(typeof process !== "undefined" && (process.env.PM2_HOME || process.env.PM2 || process.env.pm_id));
|
|
4115
|
+
const isSupervised = [
|
|
4116
|
+
"1",
|
|
4117
|
+
"true",
|
|
4118
|
+
"yes"
|
|
4119
|
+
].includes(String(process.env.MIOKU_SUPERVISED ?? "").trim().toLowerCase());
|
|
4115
4120
|
const RESTART_MARKER_PATH = path$4.join(getPluginDataDir("core"), "restart.json");
|
|
4116
4121
|
function ensureDataDir$1() {
|
|
4117
4122
|
const dir = path$4.dirname(RESTART_MARKER_PATH);
|
|
@@ -4186,6 +4191,11 @@ function triggerRestart(marker) {
|
|
|
4186
4191
|
setTimeout(() => process.exit(0), 300);
|
|
4187
4192
|
return;
|
|
4188
4193
|
}
|
|
4194
|
+
if (isSupervised) {
|
|
4195
|
+
rootLogger.info("[core] 检测到受管运行环境,退出进程后由守护方自动重启");
|
|
4196
|
+
setTimeout(() => process.exit(0), 300);
|
|
4197
|
+
return;
|
|
4198
|
+
}
|
|
4189
4199
|
const scriptPath = writeRestartScript();
|
|
4190
4200
|
try {
|
|
4191
4201
|
const child = spawn(process.platform === "win32" ? "cmd.exe" : "sh", process.platform === "win32" ? ["/c", scriptPath] : [scriptPath], {
|