@yetech/estra7ah 3.3.2 → 3.3.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/estra7ah.js +11 -5
- package/package.json +1 -1
package/dist/estra7ah.js
CHANGED
|
@@ -10,7 +10,9 @@ const RUNNERS = {
|
|
|
10
10
|
win64: "runner-win-x64.exe",
|
|
11
11
|
linux64: "runner-linux-x64",
|
|
12
12
|
linuxarm64: "runner-linux-arm64",
|
|
13
|
-
|
|
13
|
+
// pkg has no node18 armv7 target, so 32-bit ARM (Raspberry Pi OS) gets the
|
|
14
|
+
// plain webpack bundle and runs it under the system Node instead.
|
|
15
|
+
linuxarmv7: "runner.js",
|
|
14
16
|
};
|
|
15
17
|
const DIR_NAME = __dirname;
|
|
16
18
|
|
|
@@ -214,7 +216,7 @@ async function downloadRunner() {
|
|
|
214
216
|
localVersion = fs.readFileSync(versionFilePath, "utf-8");
|
|
215
217
|
}
|
|
216
218
|
|
|
217
|
-
if (localVersion !== version) {
|
|
219
|
+
if (localVersion !== version || !fs.existsSync(`${DIR_NAME}/${getRunner()}`)) {
|
|
218
220
|
console.log("** DOWNLOADING NEW RUNNER VERSION **");
|
|
219
221
|
const serverFile = `${YETECH_URL}/runner/${getRunner()}`;
|
|
220
222
|
const runnerPath = `${DIR_NAME}/${getRunner()}`;
|
|
@@ -236,20 +238,24 @@ async function downloadRunner() {
|
|
|
236
238
|
|
|
237
239
|
// Start the runner executable
|
|
238
240
|
function startRunner() {
|
|
239
|
-
const
|
|
241
|
+
const runnerFile = getRunner();
|
|
242
|
+
const runnerPath = `"${DIR_NAME}/${runnerFile}"`;
|
|
240
243
|
const args = process.argv.slice(2);
|
|
241
244
|
const options = { stdio: "inherit", shell: true };
|
|
242
245
|
|
|
243
246
|
setTimeout(() => {
|
|
244
247
|
if (process.platform !== "win32") {
|
|
245
248
|
try {
|
|
246
|
-
fs.chmodSync(`${DIR_NAME}/${
|
|
249
|
+
fs.chmodSync(`${DIR_NAME}/${runnerFile}`, "755");
|
|
247
250
|
} catch (error) {
|
|
248
251
|
console.error("Error setting permissions:", error.message);
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
|
|
255
|
+
// .js runner (armv7) runs under the same Node that launched us
|
|
256
|
+
const command = runnerFile.endsWith(".js") ? `"${process.execPath}"` : runnerPath;
|
|
257
|
+
const commandArgs = runnerFile.endsWith(".js") ? [runnerPath, ...args] : args;
|
|
258
|
+
const runnerProcess = child_process.spawn(command, commandArgs, options);
|
|
253
259
|
runnerProcess.on("exit", (code) => {
|
|
254
260
|
console.log(`Runner exited with code ${code}`);
|
|
255
261
|
});
|