mirror of
https://github.com/gchq/CyberChef
synced 2024-11-15 09:07:06 +00:00
remove unnecessary operationConfig manipulation
This commit is contained in:
parent
dd4a7f9fac
commit
7522e5de33
3 changed files with 3 additions and 10 deletions
|
@ -462,15 +462,8 @@ module.exports = function (grunt) {
|
||||||
generateNodeIndex: {
|
generateNodeIndex: {
|
||||||
command: [
|
command: [
|
||||||
"echo '\n--- Regenerating node index ---'",
|
"echo '\n--- Regenerating node index ---'",
|
||||||
// Why copy and wipe OperationConfig?
|
// Avoid cyclic dependency
|
||||||
// OperationConfig.json needs to be empty for build to avoid circular dependency on DetectFileType.
|
|
||||||
// We copy it to node dir so that we can use it as a search corpus in chef.help.
|
|
||||||
"echo 'Copying OperationConfig.json and wiping original'",
|
|
||||||
"cp src/core/config/OperationConfig.json src/node/config/OperationConfig.json",
|
|
||||||
"echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
|
"echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
|
||||||
"echo '[]\n' > src/core/config/OperationConfig.json",
|
|
||||||
"echo '\n OperationConfig.json copied to src/node/config. Modules wiped.'",
|
|
||||||
|
|
||||||
"node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs",
|
"node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs",
|
||||||
"echo '--- Node index generated. ---\n'"
|
"echo '--- Node index generated. ---\n'"
|
||||||
].join(";"),
|
].join(";"),
|
||||||
|
|
|
@ -24,7 +24,7 @@ if (!fs.existsSync(dir)) {
|
||||||
// Find all operation files
|
// Find all operation files
|
||||||
const opObjs = [];
|
const opObjs = [];
|
||||||
fs.readdirSync(path.join(dir, "../operations")).forEach(file => {
|
fs.readdirSync(path.join(dir, "../operations")).forEach(file => {
|
||||||
if (!file.endsWith(".mjs") || file === "index.mjs") return;
|
if (!file.endsWith(".mjs") || file === "index.mjs" || file === "DetectFileType.mjs" || file === "Fork.mjs" || file === "GenerateQRCode.mjs" || file === "Magic.mjs" || file === "ParseQRCode.mjs" || file === "PlayMedia.mjs" || file === "RenderImage.mjs" || file === "ScanForEmbeddedFiles.mjs" || file === "SplitColourChannels.mjs") return;
|
||||||
opObjs.push(file.split(".mjs")[0]);
|
opObjs.push(file.split(".mjs")[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
import SyncDish from "./SyncDish";
|
import SyncDish from "./SyncDish";
|
||||||
import NodeRecipe from "./NodeRecipe";
|
import NodeRecipe from "./NodeRecipe";
|
||||||
import OperationConfig from "./config/OperationConfig.json";
|
import OperationConfig from "../core/config/OperationConfig.json";
|
||||||
import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils";
|
import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils";
|
||||||
import ExludedOperationError from "../core/errors/ExcludedOperationError";
|
import ExludedOperationError from "../core/errors/ExcludedOperationError";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue