@auxcode/auxta 0.1.10 → 0.1.11

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/package.json +1 -1
  2. package/src/AuxTA.ts +4 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "",
5
5
  "main": "src/AuxTA.ts",
6
6
  "scripts": {
package/src/AuxTA.ts CHANGED
@@ -20,14 +20,10 @@ class AuxTA extends FunctionHelper {
20
20
  super();
21
21
  let file;
22
22
  try {
23
- //todo find a better way to load the file
24
23
  let currentDir = ""
25
24
  while (true) {
26
25
  file = path.join(__dirname, currentDir, "auxta.json");
27
- try {
28
- fs.accessSync(file, fs.constants.R_OK | fs.constants.W_OK)
29
- break;
30
- } catch {
26
+ if (!fs.existsSync(file)) {
31
27
  console.log("Current dir: ", file)
32
28
  console.log("Files: ")
33
29
  const files = fs.readdirSync(path.join(__dirname, currentDir));
@@ -35,12 +31,14 @@ class AuxTA extends FunctionHelper {
35
31
  console.log("- " + file);
36
32
  });
37
33
  currentDir += "../"
38
- if (currentDir.length >= 50) {
34
+ if (currentDir.length >= 30) {
39
35
  console.log("auxta.json file not found!")
40
36
  process.exit(1);
41
37
  return;
42
38
  }
39
+ continue;
43
40
  }
41
+ break;
44
42
  }
45
43
  const jsonConfig = JSON.parse(fs.readFileSync(file).toString());
46
44
  try {