lint fixes

This commit is contained in:
DBHeise 2019-01-14 10:25:14 -05:00
parent abafd09a8b
commit 5b856691e6

View file

@ -4,7 +4,7 @@
* 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.
* *
* @author David B Heise [david@heiseink.com] * @author David B Heise [david@heiseink.com]
* @copyright Crown Copyright 2018 * @copyright Crown Copyright 2018
* @license Apache-2.0 * @license Apache-2.0
*/ */
@ -14,36 +14,36 @@
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 childProcess from "child_process" import childProcess from "child_process";
const mkdirSync = function (dirPath) { const mkdirSync = function (dirPath) {
try { try {
fs.mkdirSync(dirPath) fs.mkdirSync(dirPath);
} catch (err) { } catch (err) {
if (err.code !== 'EEXIST') throw err if (err.code !== "EEXIST") throw err;
} }
} };
const mkdirpSync = function (dirPath) { const mkdirpSync = function (dirPath) {
const parts = dirPath.split(path.sep) const parts = dirPath.split(path.sep);
for (let i = 1; i <= parts.length; i++) { for (let i = 1; i <= parts.length; i++) {
mkdirSync(path.join.apply(null, parts.slice(0, i))) mkdirSync(path.join.apply(null, parts.slice(0, i)));
} }
} };
const dir = process.cwd(); const dir = process.cwd();
//Create the Destination Folder //Create the Destination Folder
mkdirpSync(path.join(dir, "src/core/config/modules")) mkdirpSync(path.join(dir, "src/core/config/modules"));
//Create the default files //Create the default files
fs.writeFileSync(path.join(dir, "src/core/config/modules/OpModules.mjs"), "export default{};\n") fs.writeFileSync(path.join(dir, "src/core/config/modules/OpModules.mjs"), "export default{};\n");
fs.writeFileSync(path.join(dir, "src/core/config/OperationConfig.json"), "[]\n") fs.writeFileSync(path.join(dir, "src/core/config/OperationConfig.json"), "[]\n");
//Run the generateOpsIndex.mjs file //Run the generateOpsIndex.mjs file
childProcess.fork(path.join(dir, "src/core/config/scripts/generateOpsIndex.mjs"), { execArgv: ["--experimental-modules","--no-warnings","--no-deprecation"]}) childProcess.fork(path.join(dir, "src/core/config/scripts/generateOpsIndex.mjs"), { execArgv: ["--experimental-modules","--no-warnings","--no-deprecation"]});
//Run the generateConfig.mjs file //Run the generateConfig.mjs file
childProcess.fork(path.join(dir, "src/core/config/scripts/generateConfig.mjs"), { execArgv: ["--experimental-modules","--no-warnings","--no-deprecation"]}) childProcess.fork(path.join(dir, "src/core/config/scripts/generateConfig.mjs"), { execArgv: ["--experimental-modules","--no-warnings","--no-deprecation"]});