Browse Source

Remove duplicate wiping of opconfig in node index config script

d98762625 7 years ago
parent
commit
f51d924ec9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Gruntfile.js

+ 3 - 2
Gruntfile.js

@@ -392,14 +392,15 @@ module.exports = function (grunt) {
             generateNodeIndex: {
                 command: [
                     "echo '\n--- Regenerating node index ---'",
+                    // Why copy and wipe OperationConfig?
+                    // 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 '[]\n' > src/core/config/OperationConfig.json",
                     "echo '\n OperationConfig.json copied to src/node/config. Modules wiped.'",
 
-                    "echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
-                    "echo '[]\n' > src/core/config/OperationConfig.json",
                     "node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs",
                     "echo '--- Node index generated. ---\n'"
                 ].join(";"),