Skip to content

Commit

Permalink
#38: show number of fixed keys across BUs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Aug 1, 2023
1 parent 4713e19 commit e81c54e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ class Mcdev {
Util.logger.info(`mcdev:: ${methodName} ${selectedType}`);
const properties = await config.getProperties();
let counter_credBu = 0;
let counter_credKeys = 0;
if (!(await config.checkProperties(properties))) {
// return null here to avoid seeing 2 error messages for the same issue
return resultObj;
Expand Down Expand Up @@ -871,6 +872,7 @@ class Mcdev {
for (const cred in properties.credentials) {
Util.logger.info(`:: ${lang_present} ${selectedType} on all BUs for ${cred}`);
// reset counter per cred
counter_credKeys = 0;
counter_credBu = 0;
for (const bu in properties.credentials[cred].businessUnits) {
resultObj[cred + '/' + bu] = await this.#runOnBU(
Expand All @@ -881,11 +883,12 @@ class Mcdev {
keys
);
counter_credBu++;
counter_credKeys += resultObj[cred + '/' + bu].length;
Util.startLogger(true);
}
counter_credTotal += counter_credBu;
Util.logger.info(
`:: ${lang_past} ${selectedType} on ${counter_credBu} BUs for ${cred}`
`:: ${lang_past} for ${counter_credKeys} ${selectedType}s on ${counter_credBu} BUs for ${cred}`
);
}
Util.logger.info(
Expand Down Expand Up @@ -923,10 +926,11 @@ class Mcdev {
keys
);
counter_credBu++;
counter_credKeys += resultObj[cred + '/' + bu].length;
Util.startLogger(true);
}
Util.logger.info(
`:: ${lang_past} ${selectedType} on ${counter_credBu} BUs for ${cred}`
`:: ${lang_past} for ${counter_credKeys} ${selectedType}s on ${counter_credBu} BUs for ${cred}`
);
} else {
// execute runMethod for the entity on one BU only
Expand Down Expand Up @@ -1101,7 +1105,7 @@ class Mcdev {
const keysForDeploy = MetadataTypeInfo[type].getKeysForFixing(metadataMap);
if (keysForDeploy.length < 1) {
Util.logger.error(
`No items found with a key-name mismatch that match your criteria.`
`No items found with a key-name mismatch that match your criteria.\n`
);
return resultArr;
}
Expand Down

0 comments on commit e81c54e

Please sign in to comment.