mcdev 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5346,13 +5346,13 @@ Central class for loading and validating properties from config and auth
5346
5346
  **Kind**: global constant
5347
5347
 
5348
5348
  * [config](#config)
5349
- * [.getProperties([silent])](#config.getProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
5349
+ * [.getProperties([silent], [isInit])](#config.getProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
5350
5350
  * [.checkProperties(properties, [silent])](#config.checkProperties) ⇒ <code>Promise.&lt;(boolean\|Array.&lt;string&gt;)&gt;</code>
5351
5351
  * [.getDefaultProperties()](#config.getDefaultProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
5352
5352
 
5353
5353
  <a name="config.getProperties"></a>
5354
5354
 
5355
- ### config.getProperties([silent]) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
5355
+ ### config.getProperties([silent], [isInit]) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
5356
5356
  loads central properties from config file
5357
5357
 
5358
5358
  **Kind**: static method of [<code>config</code>](#config)
@@ -5361,6 +5361,7 @@ loads central properties from config file
5361
5361
  | Param | Type | Description |
5362
5362
  | --- | --- | --- |
5363
5363
  | [silent] | <code>boolean</code> | omit throwing errors and print messages; assuming not silent if not set |
5364
+ | [isInit] | <code>boolean</code> | don't tell the user to run init |
5364
5365
 
5365
5366
  <a name="config.checkProperties"></a>
5366
5367
 
package/lib/index.js CHANGED
@@ -290,7 +290,7 @@ class Mcdev {
290
290
  */
291
291
  static async initProject(credentialsName) {
292
292
  Util.logger.info('mcdev:: Setting up project');
293
- const properties = await config.getProperties(!!credentialsName);
293
+ const properties = await config.getProperties(!!credentialsName, true);
294
294
  await Init.initProject(properties, credentialsName);
295
295
  }
296
296
 
@@ -14,9 +14,10 @@ const config = {
14
14
  * loads central properties from config file
15
15
  *
16
16
  * @param {boolean} [silent] omit throwing errors and print messages; assuming not silent if not set
17
+ * @param {boolean} [isInit] don't tell the user to run init
17
18
  * @returns {Promise.<TYPE.Mcdevrc>} central properties object
18
19
  */
19
- async getProperties(silent) {
20
+ async getProperties(silent, isInit) {
20
21
  if (config.properties) {
21
22
  return config.properties;
22
23
  }
@@ -65,7 +66,7 @@ const config = {
65
66
  return;
66
67
  }
67
68
  }
68
- } else if (!silent) {
69
+ } else if (!silent && !isInit) {
69
70
  Util.logger.error(
70
71
  `${Util.authFileName} not found. Please run 'mcdev init' to provide the missing credential details.`
71
72
  );
package/lib/util/init.js CHANGED
@@ -341,9 +341,9 @@ const Init = {
341
341
  let auth;
342
342
  try {
343
343
  auth = File.readJsonSync(Util.authFileName);
344
- } catch (ex) {
345
- Util.logger.error(`${ex.code}: ${ex.message}`);
346
- return;
344
+ } catch {
345
+ // file not found
346
+ auth = [];
347
347
  }
348
348
  // walk through config credentials and check if the matching credential in the auth file is missing something
349
349
  missingCredentials = Object.keys(properties.credentials).filter(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcdev",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Accenture Salesforce Marketing Cloud DevTools",
5
5
  "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
6
6
  "license": "MIT",