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
|
||||
* 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.
|
||||
* This script automatically generates empty default files
|
||||
*
|
||||
* @author David B Heise [david@heiseink.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import process from "process";
|
||||
|
@ -18,6 +13,7 @@ import childProcess from "child_process";
|
|||
|
||||
|
||||
const mkdirSync = function (dirPath) {
|
||||
console.log("Ensuring Folder: " + dirPath)
|
||||
try {
|
||||
fs.mkdirSync(dirPath);
|
||||
} catch (err) {
|
||||
|
@ -34,13 +30,14 @@ const mkdirpSync = function (dirPath) {
|
|||
|
||||
|
||||
const dir = process.cwd();
|
||||
const newPath = path.join(dir, "src/core/config/modules");
|
||||
|
||||
//Create the Destination Folder
|
||||
mkdirpSync(path.join(dir, "src/core/config/modules"));
|
||||
mkdirpSync(newPath);
|
||||
|
||||
//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/OperationConfig.json"), "[]\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", {"flag": "w"});
|
||||
|
||||
//Run the generateOpsIndex.mjs file
|
||||
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