@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.
Files changed (2) hide show
  1. package/dist/estra7ah.js +11 -5
  2. 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
- linuxarmv7: "runner-linux-armv7",
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 runnerPath = `"${DIR_NAME}/${getRunner()}"`;
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}/${getRunner()}`, "755");
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
- const runnerProcess = child_process.spawn(runnerPath, args, options);
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yetech/estra7ah",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "Estra7ah Manager",
5
5
  "author": "Abdullah Al-taheri",
6
6
  "keywords": [