@yetech/estra7ah 1.1.3 → 1.1.4

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 CHANGED
@@ -14,7 +14,7 @@ const fs = require("fs");
14
14
  async function start() {
15
15
  let version = null;
16
16
  let localVersion = null;
17
-
17
+ const dir_name = __dirname;
18
18
  const yetech = `http://premium.yetech.co:80`;
19
19
  try {
20
20
  const data = await axios.get(`${yetech}/runner/version`, {
@@ -29,8 +29,8 @@ async function start() {
29
29
  }
30
30
 
31
31
  try {
32
- if (fs.existsSync("./__runnerversion")) {
33
- localVersion = fs.readFileSync("./__runnerversion").toString();
32
+ if (fs.existsSync(dir_name + "/__runnerversion")) {
33
+ localVersion = fs.readFileSync(dir_name + "/__runnerversion").toString();
34
34
  }
35
35
 
36
36
  if (localVersion !== version) {
@@ -43,14 +43,14 @@ async function start() {
43
43
 
44
44
  ungzip(data.data).then((uncompressed) => {
45
45
  // unlink old file
46
- if (fs.existsSync("./runner.js")) {
47
- fs.unlinkSync("./runner.js");
46
+ if (fs.existsSync(dir_name + "/runner.js")) {
47
+ fs.unlinkSync(dir_name + "/runner.js");
48
48
  }
49
- fs.writeFileSync("./runner.js", uncompressed, {
49
+ fs.writeFileSync(dir_name + "/runner.js", uncompressed, {
50
50
  encoding: "utf8",
51
51
  overwrite: true,
52
52
  });
53
- fs.writeFileSync("./__runnerversion", version);
53
+ fs.writeFileSync(dir_name + "/__runnerversion", version);
54
54
  });
55
55
  }
56
56
  } catch (err) {
@@ -58,7 +58,7 @@ async function start() {
58
58
  }
59
59
 
60
60
  setTimeout(() => {
61
- require("./runner.js");
61
+ require(dir_name + "/runner.js");
62
62
  }, 3000);
63
63
  }
64
64
  start();