|
@@ -1,6 +1,6 @@
|
|
/**
|
|
/**
|
|
* This script automatically generates OperationConfig.json, containing metadata
|
|
* This script automatically generates OperationConfig.json, containing metadata
|
|
- * for each opeartion in the src/core/operations directory.
|
|
|
|
|
|
+ * for each operation in the src/core/operations directory.
|
|
* It also generates modules in the src/core/config/modules directory to separate
|
|
* It also generates modules in the src/core/config/modules directory to separate
|
|
* out operations into logical collections.
|
|
* out operations into logical collections.
|
|
*
|
|
*
|
|
@@ -14,13 +14,13 @@
|
|
import path from "path";
|
|
import path from "path";
|
|
import fs from "fs";
|
|
import fs from "fs";
|
|
import process from "process";
|
|
import process from "process";
|
|
-import * as Ops from "../operations/index";
|
|
|
|
|
|
+import * as Ops from "../../operations/index";
|
|
|
|
|
|
const dir = path.join(process.cwd() + "/src/core/config/");
|
|
const dir = path.join(process.cwd() + "/src/core/config/");
|
|
if (!fs.existsSync(dir)) {
|
|
if (!fs.existsSync(dir)) {
|
|
console.log("\nCWD: " + process.cwd());
|
|
console.log("\nCWD: " + process.cwd());
|
|
console.log("Error: generateConfig.mjs should be run from the project root");
|
|
console.log("Error: generateConfig.mjs should be run from the project root");
|
|
- console.log("Example> node --experimental-modules src/core/config/generateConfig.mjs");
|
|
|
|
|
|
+ console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs");
|
|
process.exit(1);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -69,7 +69,7 @@ fs.writeFile(
|
|
*/
|
|
*/
|
|
for (const module in modules) {
|
|
for (const module in modules) {
|
|
let code = `/**
|
|
let code = `/**
|
|
-* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/generateConfig.mjs
|
|
|
|
|
|
+* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
|
*
|
|
*
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
|
|
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
|
|
@@ -113,7 +113,7 @@ export default OpModules;
|
|
* Write OpModules wrapper.
|
|
* Write OpModules wrapper.
|
|
*/
|
|
*/
|
|
let opModulesCode = `/**
|
|
let opModulesCode = `/**
|
|
-* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/generateConfig.mjs
|
|
|
|
|
|
+* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
|
*
|
|
*
|
|
* Imports all modules for builds which do not load modules separately.
|
|
* Imports all modules for builds which do not load modules separately.
|
|
*
|
|
*
|