@loybung/launcher 2.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +6 -5
- package/package.json +1 -1
package/index.js
CHANGED
@@ -2,6 +2,9 @@ const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
3
3
|
|
4
4
|
async function launcher({ url: url, filepath: filepath }, callback) {
|
5
|
+
console.clear();
|
6
|
+
console.log("( LOYBUNG Launcher ) => Fetching...");
|
7
|
+
|
5
8
|
const response = await fetch(url);
|
6
9
|
if (!response.ok) {
|
7
10
|
throw new Error(`ดึงข้อมูลผิดพลาด! | Status: ${response.status}`);
|
@@ -14,11 +17,9 @@ async function launcher({ url: url, filepath: filepath }, callback) {
|
|
14
17
|
return;
|
15
18
|
}
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
callback(run);
|
21
|
-
});
|
20
|
+
const app = path.resolve(__dirname, `../../../${filepath}`);
|
21
|
+
const { run } = require(app);
|
22
|
+
callback(run);
|
22
23
|
});
|
23
24
|
}
|
24
25
|
|