@auxcode/auxta 0.4.9 → 0.5.0
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/package.json +1 -1
- package/src/AuxTA.ts +26 -22
package/package.json
CHANGED
package/src/AuxTA.ts
CHANGED
|
@@ -20,32 +20,36 @@ class AuxTA extends FunctionHelper {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
let file;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
if (!process.env.RPA) {
|
|
24
|
+
try {
|
|
25
|
+
let currentDir = ""
|
|
26
|
+
while (true) {
|
|
27
|
+
file = path.join(__dirname, currentDir, "auxta.json");
|
|
28
|
+
if (!fs.existsSync(file)) {
|
|
29
|
+
currentDir += "../"
|
|
30
|
+
if (currentDir.length >= 30) {
|
|
31
|
+
console.log("auxta.json file not found!")
|
|
32
|
+
process.exit(1);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
continue;
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
break;
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const jsonConfig = JSON.parse(fs.readFileSync(file).toString());
|
|
40
|
+
try {
|
|
41
|
+
this.config = setupConfig(jsonConfig)
|
|
42
|
+
} catch (e) {
|
|
43
|
+
console.log("Missing field in auxta.json:", e)
|
|
44
|
+
}
|
|
45
|
+
this.uploadModel = new UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment);
|
|
41
46
|
} catch (e) {
|
|
42
|
-
console.log("Missing
|
|
47
|
+
console.log("Missing or corrupted config: auxta.json. Searching in location:", file)
|
|
48
|
+
console.log(e);
|
|
49
|
+
process.exit(1);
|
|
43
50
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
console.log("Missing or corrupted config: auxta.json. Searching in location:", file)
|
|
47
|
-
console.log(e);
|
|
48
|
-
process.exit(1);
|
|
51
|
+
} else {
|
|
52
|
+
this.uploadModel = new UploadModel('', '', '', '');
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|