Skip to content

Commit

Permalink
Merge pull request #614 from Accenture/develop
Browse files Browse the repository at this point in the history
4.2.1
  • Loading branch information
JoernBerkefeld authored Dec 15, 2022
2 parents 1861682 + 02bcebd commit 29a9598
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
5 changes: 3 additions & 2 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5346,13 +5346,13 @@ Central class for loading and validating properties from config and auth
**Kind**: global constant

* [config](#config)
* [.getProperties([silent])](#config.getProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
* [.getProperties([silent], [isInit])](#config.getProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
* [.checkProperties(properties, [silent])](#config.checkProperties) ⇒ <code>Promise.&lt;(boolean\|Array.&lt;string&gt;)&gt;</code>
* [.getDefaultProperties()](#config.getDefaultProperties) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>

<a name="config.getProperties"></a>

### config.getProperties([silent]) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
### config.getProperties([silent], [isInit]) ⇒ <code>Promise.&lt;TYPE.Mcdevrc&gt;</code>
loads central properties from config file

**Kind**: static method of [<code>config</code>](#config)
Expand All @@ -5361,6 +5361,7 @@ loads central properties from config file
| Param | Type | Description |
| --- | --- | --- |
| [silent] | <code>boolean</code> | omit throwing errors and print messages; assuming not silent if not set |
| [isInit] | <code>boolean</code> | don't tell the user to run init |

<a name="config.checkProperties"></a>

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class Mcdev {
*/
static async initProject(credentialsName) {
Util.logger.info('mcdev:: Setting up project');
const properties = await config.getProperties(!!credentialsName);
const properties = await config.getProperties(!!credentialsName, true);
await Init.initProject(properties, credentialsName);
}

Expand Down
5 changes: 3 additions & 2 deletions lib/util/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const config = {
* loads central properties from config file
*
* @param {boolean} [silent] omit throwing errors and print messages; assuming not silent if not set
* @param {boolean} [isInit] don't tell the user to run init
* @returns {Promise.<TYPE.Mcdevrc>} central properties object
*/
async getProperties(silent) {
async getProperties(silent, isInit) {
if (config.properties) {
return config.properties;
}
Expand Down Expand Up @@ -65,7 +66,7 @@ const config = {
return;
}
}
} else if (!silent) {
} else if (!silent && !isInit) {
Util.logger.error(
`${Util.authFileName} not found. Please run 'mcdev init' to provide the missing credential details.`
);
Expand Down
6 changes: 3 additions & 3 deletions lib/util/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ const Init = {
let auth;
try {
auth = File.readJsonSync(Util.authFileName);
} catch (ex) {
Util.logger.error(`${ex.code}: ${ex.message}`);
return;
} catch {
// file not found
auth = [];
}
// walk through config credentials and check if the matching credential in the auth file is missing something
missingCredentials = Object.keys(properties.credentials).filter(
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mcdev",
"version": "4.2.0",
"version": "4.2.1",
"description": "Accenture Salesforce Marketing Cloud DevTools",
"author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
"license": "MIT",
Expand Down

0 comments on commit 29a9598

Please sign in to comment.