@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.
- package/index.js +7 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -20,14 +20,18 @@ async function launcher(
|
|
20
20
|
return;
|
21
21
|
}
|
22
22
|
|
23
|
-
|
24
|
-
|
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
|
}
|