2019-01-14 10:03:30 -05:00
|
|
|
/**
|
2019-01-15 09:08:42 -05:00
|
|
|
* This script automatically generates empty default files
|
2019-01-14 10:03:30 -05:00
|
|
|
*
|
2019-01-14 10:25:14 -05:00
|
|
|
* @author David B Heise [david@heiseink.com]
|
2019-01-14 10:03:30 -05:00
|
|
|
* @copyright Crown Copyright 2018
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
import path from "path";
|
|
|
|
import fs from "fs";
|
|
|
|
import process from "process";
|
2019-01-14 10:25:14 -05:00
|
|
|
import childProcess from "child_process";
|
2019-01-14 10:03:30 -05:00
|
|
|
|
|
|
|
const dir = process.cwd();
|
2019-01-15 09:08:42 -05:00
|
|
|
const newPath = path.join(dir, "src/core/config/modules");
|
2019-01-14 10:03:30 -05:00
|
|
|
|
|
|
|
//Create the Destination Folder
|
2019-01-15 10:02:20 -05:00
|
|
|
fs.mkdirSync(newPath, { recursive: true });
|
2019-01-14 10:03:30 -05:00
|
|
|
|
|
|
|
//Create the default files
|
2019-01-15 09:42:26 -05:00
|
|
|
fs.writeFileSync(path.join(newPath, "OpModules.mjs"), "export default{};\n");
|
|
|
|
fs.writeFileSync(path.join(dir, "src/core/config/OperationConfig.json"), "[]\n");
|
2019-01-14 10:03:30 -05:00
|
|
|
|
|
|
|
//Run the generateOpsIndex.mjs file
|
2019-01-15 09:08:42 -05:00
|
|
|
childProcess.fork(path.join(dir, "src/core/config/scripts/generateOpsIndex.mjs"), { execArgv: ["--experimental-modules", "--no-warnings", "--no-deprecation"]});
|
2019-01-14 10:03:30 -05:00
|
|
|
|
|
|
|
//Run the generateConfig.mjs file
|
2019-01-15 09:08:42 -05:00
|
|
|
childProcess.fork(path.join(dir, "src/core/config/scripts/generateConfig.mjs"), { execArgv: ["--experimental-modules", "--no-warnings", "--no-deprecation"]});
|