mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 08:15:00 -04:00
another lint change
This commit is contained in:
parent
5b856691e6
commit
ae8bafc8b7
1 changed files with 8 additions and 11 deletions
|
@ -1,16 +1,11 @@
|
||||||
/**
|
/**
|
||||||
* This script automatically generates OperationConfig.json, containing metadata
|
* This script automatically generates empty default files
|
||||||
* for each operation in the src/core/operations directory.
|
|
||||||
* It also generates modules in the src/core/config/modules directory to separate
|
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*eslint no-console: ["off"] */
|
|
||||||
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import process from "process";
|
import process from "process";
|
||||||
|
@ -18,6 +13,7 @@ import childProcess from "child_process";
|
||||||
|
|
||||||
|
|
||||||
const mkdirSync = function (dirPath) {
|
const mkdirSync = function (dirPath) {
|
||||||
|
console.log("Ensuring Folder: " + dirPath)
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(dirPath);
|
fs.mkdirSync(dirPath);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -34,13 +30,14 @@ const mkdirpSync = function (dirPath) {
|
||||||
|
|
||||||
|
|
||||||
const dir = process.cwd();
|
const dir = process.cwd();
|
||||||
|
const newPath = path.join(dir, "src/core/config/modules");
|
||||||
|
|
||||||
//Create the Destination Folder
|
//Create the Destination Folder
|
||||||
mkdirpSync(path.join(dir, "src/core/config/modules"));
|
mkdirpSync(newPath);
|
||||||
|
|
||||||
//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", {"flag": "w"});
|
||||||
fs.writeFileSync(path.join(dir, "src/core/config/OperationConfig.json"), "[]\n");
|
fs.writeFileSync(path.join(dir, "src/core/config/OperationConfig.json"), "[]\n", {"flag": "w"});
|
||||||
|
|
||||||
//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"]});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue