Repository: Accenture/sfmc-devtools
Pull request #541 (2022-11-09 14:52:35)

4.1.12
release


Patch:
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index a6813c6d..d2b99229 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -39,6 +39,7 @@ body:
           label: Version
           description: What version of our software are you running? (mcdev --version)
           options:
+              - 4.1.12
               - 4.1.11
               - 4.1.10
               - 4.1.9
diff --git a/README.md b/README.md
index da30f3e7..f5833b1e 100644
--- a/README.md
+++ b/README.md
@@ -123,7 +123,7 @@ If you experience issues installing Accenture SFMC DevTools, please check out th
 1. Install Accenture SFMC DevTools by running `npm install -g mcdev` (prefix with `sudo` on MacOS)
    - If you get an error, please see the below troubleshooting section.
 
-When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.11`).
+When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.12`).
 
 > **_Side note for proud nerds_:**
 >
@@ -277,10 +277,10 @@ _Note: Regardless of which tag or branch you install_
 **Install specific version (using a version tag on npm):**
 
 ```bash
-npm install -g mcdev@4.1.11
+npm install -g mcdev@4.1.12
 ```
 
-**Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 4.1.11)!
+**Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 4.1.12)!
 
 > **Note**: The version is currently _not_ updated on the developer branch until a new release is published. Hence, you will not see a change if you run `mcdev --version`.
 
@@ -1505,7 +1505,7 @@ Assuming you cloned Accenture SFMC DevTools into `C:\repos\sfmc-devtools\` (or `
 
 This should tell npm to create a symlink to your cloned local directory, allowing you to see updates you make in your mcdev repo instantly.
 
-To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `4.1.11`). Then, go into your mcdev repo and update the version with the suffix `-dev`, e.g. to `4.1.11-dev` and then run `mcdev --version` again to verify that your change propagates instantly.
+To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `4.1.12`). Then, go into your mcdev repo and update the version with the suffix `-dev`, e.g. to `4.1.12-dev` and then run `mcdev --version` again to verify that your change propagates instantly.
 
 > **Not recommended:** Alternatively, you can install it locally only by opening a terminal in your project directory and executing `npm install --save-dev "C:\repos\sfmc-devtools"`
 > To run the local version you need to prepend "npx" before your commands, e.g. `npx mcdev --version`
@@ -1543,7 +1543,7 @@ The following explains how you _could_ install it locally for certain edge cases
 4. Afterwards, install Accenture SFMC DevTools by running `npm install --save-dev mcdev`
    - If you get an error, please see the below troubleshooting section.
 
-When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.11`).
+When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.12`).
 
 ### 9.3. NPM Scripts
 
diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json
index 3677550e..1ed32c22 100644
--- a/boilerplate/files/.vscode/settings.json
+++ b/boilerplate/files/.vscode/settings.json
@@ -12,22 +12,23 @@
         "tsconfig.json": "tsconfig.*.json",
         "package.json": "package-lock.json, yarn.lock",
         "*-doc.md": "${capture}-meta.json",
+        "*-meta.amp": "${capture}-meta.json",
+        "*-meta.html": "${capture}-meta.json",
+        "*-meta.sql": "${capture}-meta.json",
+        "*-meta.ssjs": "${capture}-meta.json",
         "*.asset-asset-meta.html": "${dirname}.asset-asset-meta.json",
         "*.asset-message-meta.html": "${dirname}.asset-message-meta.json",
-        "*.html": "${capture}.asset-code-meta.json",
         "*.css": "${capture}.asset-code-meta.json",
         "*.docx": "${capture}.asset-document-meta.json",
+        "*.eps": "${capture}.asset-image-meta.json",
+        "*.gif": "${capture}.asset-image-meta.json",
+        "*.html": "${capture}.asset-code-meta.json",
         "*.ics": "${capture}.asset-document-meta.json",
-        "*.pdf": "${capture}.asset-document-meta.json",
-        "*.jpg": "${capture}.asset-image-meta.json",
         "*.jpeg": "${capture}.asset-image-meta.json",
+        "*.jpg": "${capture}.asset-image-meta.json",
+        "*.pdf": "${capture}.asset-document-meta.json",
         "*.png": "${capture}.asset-image-meta.json",
-        "*.gif": "${capture}.asset-image-meta.json",
-        "*.eps": "${capture}.asset-image-meta.json",
-        "*-meta.sql": "${capture}-meta.json",
-        "*-meta.ssjs": "${capture}-meta.json",
-        "*-meta.amp": "${capture}-meta.json",
-        "*-meta.html": "${capture}-meta.json"
+        "*.txt": "${capture}.asset-textfile-meta.json"
     },
     "editor.codeActionsOnSave": {
         "source.fixAll.eslint": true
diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json
index 0cd0ed8b..15b6f565 100644
--- a/boilerplate/forcedUpdates.json
+++ b/boilerplate/forcedUpdates.json
@@ -1,4 +1,8 @@
 [
+    {
+        "version": "4.1.12",
+        "files": [".vscode/settings.json"]
+    },
     {
         "version": "4.1.1",
         "files": [".vscode/settings.json"]
diff --git a/lib/Retriever.js b/lib/Retriever.js
index 4288b5d8..79e0799a 100644
--- a/lib/Retriever.js
+++ b/lib/Retriever.js
@@ -100,7 +100,8 @@ class Retriever {
                 } else {
                     let cacheResult = null;
                     if (
-                        Object.keys(typeKeyMap[metadataType])[0] !== null &&
+                        (typeKeyMap[metadataType].length > 1 ||
+                            typeKeyMap[metadataType][0] !== null) &&
                         (dependencies.includes(type) || dependencies.includes(metadataType))
                     ) {
                         // if we have a key-list and the type is a dependency, we need to cache the whole type
diff --git a/lib/util/init.git.js b/lib/util/init.git.js
index bf588b04..2ee5caf4 100644
--- a/lib/util/init.git.js
+++ b/lib/util/init.git.js
@@ -110,7 +110,7 @@ const Init = {
                         },
                     ]);
                 }
-                if (skipInteraction.gitPush === 'true' || responses?.gitPush) {
+                if (skipInteraction?.gitPush === 'true' || responses?.gitPush) {
                     Util.execSync('git', ['push', '-u', 'origin', 'master']);
                 }
             } else if (remoteBranchesExist === true) {
diff --git a/lib/util/init.js b/lib/util/init.js
index acb55e91..26ab0c8b 100644
--- a/lib/util/init.js
+++ b/lib/util/init.js
@@ -202,7 +202,7 @@ const Init = {
                 },
             ]);
         }
-        if (skipInteraction.downloadBUs === 'true' || responses?.initialRetrieveAll) {
+        if (skipInteraction?.downloadBUs === 'true' || responses?.initialRetrieveAll) {
             Util.execSync('mcdev', ['retrieve', bu]);
 
             if (gitStatus === 'init') {
diff --git a/lib/util/util.js b/lib/util/util.js
index 5a4227be..394ab55f 100644
--- a/lib/util/util.js
+++ b/lib/util/util.js
@@ -130,6 +130,7 @@ const Util = {
      * @returns {void}
      */
     signalFatalError() {
+        Util.logger.debug('Util.signalFataError() sets process.exitCode = 1');
         process.exitCode = 1;
     },
     /**
@@ -497,7 +498,10 @@ function startLogger() {
          */
         errorStack: function (ex, message) {
             if (message) {
-                myWinston.error(message + ': ' + ex.message);
+                // ! this method only sets exitCode=1 if message-param was set
+                // if not, then this method purely outputs debug information and should not change the exitCode
+                winstonError(message + ': ' + ex.message);
+                Util.signalFatalError();
             }
             let stack;
             /* eslint-disable unicorn/prefer-ternary */
@@ -513,7 +517,6 @@ function startLogger() {
             }
             /* eslint-enable unicorn/prefer-ternary */
             myWinston.debug(stack);
-            Util.signalFatalError();
         },
         /**
          * errors should cause surrounding applications to take notice
diff --git a/package-lock.json b/package-lock.json
index e3e00d61..c64643ac 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
     "name": "mcdev",
-    "version": "4.1.11",
+    "version": "4.1.12",
     "lockfileVersion": 2,
     "requires": true,
     "packages": {
         "": {
             "name": "mcdev",
-            "version": "4.1.11",
+            "version": "4.1.12",
             "license": "MIT",
             "dependencies": {
                 "cli-progress": "3.11.2",
diff --git a/package.json b/package.json
index abb1beef..2cc94c2e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "mcdev",
-    "version": "4.1.11",
+    "version": "4.1.12",
     "description": "Accenture Salesforce Marketing Cloud DevTools",
     "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
     "license": "MIT",


Test patch:
diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json
index e1859329..7cc7db44 100644
--- a/test/mockRoot/.mcdevrc.json
+++ b/test/mockRoot/.mcdevrc.json
@@ -63,5 +63,5 @@
             "triggeredSendDefinition"
         ]
     },
-    "version": "4.1.11"
+    "version": "4.1.12"
 }