tauri-test-cli 0.8.0 → 0.9.0
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.js +14 -25
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -122032,35 +122032,24 @@ async function startServer(options) {
|
|
|
122032
122032
|
const { port, appPath, waitTimeout, autoWait } = options;
|
|
122033
122033
|
process.on("SIGINT", shutdown);
|
|
122034
122034
|
process.on("SIGTERM", shutdown);
|
|
122035
|
-
const
|
|
122036
|
-
|
|
122037
|
-
|
|
122038
|
-
|
|
122039
|
-
|
|
122040
|
-
|
|
122041
|
-
const ppid = parseInt(stat.split(") ")[1].split(" ")[1]);
|
|
122042
|
-
if (ppid <= 1)
|
|
122043
|
-
break;
|
|
122044
|
-
pids.push(ppid);
|
|
122045
|
-
pid = ppid;
|
|
122046
|
-
} catch {
|
|
122047
|
-
break;
|
|
122048
|
-
}
|
|
122035
|
+
const getDirectParentPid = () => {
|
|
122036
|
+
try {
|
|
122037
|
+
const stat = readFileSync(`/proc/${process.pid}/stat`, "utf8");
|
|
122038
|
+
return parseInt(stat.split(") ")[1].split(" ")[1]);
|
|
122039
|
+
} catch {
|
|
122040
|
+
return process.ppid;
|
|
122049
122041
|
}
|
|
122050
|
-
return pids;
|
|
122051
122042
|
};
|
|
122052
|
-
const
|
|
122053
|
-
if (
|
|
122043
|
+
const parentPid = getDirectParentPid();
|
|
122044
|
+
if (parentPid > 1) {
|
|
122054
122045
|
setInterval(() => {
|
|
122055
|
-
|
|
122056
|
-
|
|
122057
|
-
|
|
122058
|
-
|
|
122059
|
-
|
|
122060
|
-
return;
|
|
122061
|
-
}
|
|
122046
|
+
try {
|
|
122047
|
+
process.kill(parentPid, 0);
|
|
122048
|
+
} catch {
|
|
122049
|
+
shutdown();
|
|
122050
|
+
return;
|
|
122062
122051
|
}
|
|
122063
|
-
},
|
|
122052
|
+
}, 2000);
|
|
122064
122053
|
}
|
|
122065
122054
|
console.error(`Launching app and waiting for load (timeout: ${waitTimeout}ms)...`);
|
|
122066
122055
|
await connect2({ appPath, waitTimeout });
|