mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 15:55:01 -04:00
lint fixes
This commit is contained in:
parent
abafd09a8b
commit
5b856691e6
1 changed files with 13 additions and 13 deletions
|
@ -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"]});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue