@loybung/launcher 4.1.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -20,14 +20,18 @@ async function launcher(
20
20
  return;
21
21
  }
22
22
 
23
- const app = path.resolve(__dirname, `../../../${filepath}`); // `../../../${filepath}`
24
- const { run } = require(app);
23
+ let appPath = filepath;
24
+ if (!path.isAbsolute(filepath)) {
25
+ appPath = path.resolve(__dirname, filepath);
26
+ }
27
+
28
+ const { run } = require(appPath);
25
29
  callback(run, expire);
26
30
  });
27
31
 
28
32
  if (expire) {
29
33
  setInterval(() => {
30
- if (expire < Date.now()) process.exit();
34
+ if (expire < Mathfloor(Date.now() / 1000)) process.exit();
31
35
  }, 5000);
32
36
  }
33
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loybung/launcher",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "LOYBUNG / Launcher",
5
5
  "main": "index.js",
6
6
  "scripts": {