testaro 8.0.0 → 8.0.1
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/high.js +1 -15
- package/package.json +1 -1
package/high.js
CHANGED
|
@@ -17,7 +17,6 @@ const {doJob} = require('./run');
|
|
|
17
17
|
|
|
18
18
|
const scriptDir = process.env.SCRIPTDIR;
|
|
19
19
|
const reportDir = process.env.REPORTDIR;
|
|
20
|
-
const scriptID = process.argv[2];
|
|
21
20
|
|
|
22
21
|
// ########## VARIABLES
|
|
23
22
|
|
|
@@ -27,7 +26,7 @@ let timeLimit = 300;
|
|
|
27
26
|
// ########## FUNCTIONS
|
|
28
27
|
|
|
29
28
|
// Performs a file-based job and writes a report file.
|
|
30
|
-
|
|
29
|
+
exports.runJob = async scriptID => {
|
|
31
30
|
try {
|
|
32
31
|
const scriptJSON = await fs.readFile(`${scriptDir}/${scriptID}.json`, 'utf8');
|
|
33
32
|
const script = JSON.parse(scriptJSON);
|
|
@@ -49,16 +48,3 @@ const runJob = async scriptID => {
|
|
|
49
48
|
console.log(`ERROR running job (${error.message})\n${error.stack}`);
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
|
|
53
|
-
// ########## OPERATION
|
|
54
|
-
|
|
55
|
-
// If this module was called with a scriptID argument:
|
|
56
|
-
if (scriptID) {
|
|
57
|
-
// Run the script and write a report.
|
|
58
|
-
runJob(scriptID);
|
|
59
|
-
}
|
|
60
|
-
// Otherwise, i.e. if it was required by another module:
|
|
61
|
-
else {
|
|
62
|
-
// Export runJob so the other module can call it.
|
|
63
|
-
exports.runJob = runJob;
|
|
64
|
-
}
|