Skip to content

Commit

Permalink
Merge pull request #1262 from Accenture/task/1200-show-dedicated-mess…
Browse files Browse the repository at this point in the history
…ages-to-accenture-non-accenture

Task/1200 show dedicated messages to accenture and non-accenture users
  • Loading branch information
JoernBerkefeld committed Apr 16, 2024
2 parents 7730620 + 509f0a5 commit 0cbd5b9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,35 @@ class Mcdev {
return Init.upgradeProject(properties, false);
}

/**
* helper to show an off-the-logs message to users
*/
static #welcomeMessage() {
const color = Util.isRunViaVSCodeExtension
? { reset: '', bgWhite: '', fgBlue: '' }
: Util.color;
/* eslint-disable no-console */
if (process.env['USERDNSDOMAIN'] === 'DIR.SVC.ACCENTURE.COM') {
// Accenture internal message
console.log(
`\n` +
` Thank you for using Accenture SFMC DevTools on your Accenture laptop!\n` +
` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message\n` +
` in our Accenture Teams channel ${color.bgWhite}telling us about your journey with mcdev${color.reset}: ${color.fgBlue}https://go.accenture.com/mcdevTeams${color.reset}.\n` +
`\n` +
` For any questions or concerns, please feel free to create a ticket in GitHub: ${color.fgBlue}https://bit.ly/mcdev-support${color.reset}.\n`
);
} else {
// external message
console.log(
`\n` +
` Thank you for using Accenture SFMC DevTools!\n` +
`\n` +
` For any questions or concerns, please feel free to create a ticket in GitHub: ${color.fgBlue}https://bit.ly/mcdev-support${color.reset}.\n`
);
}
/* eslint-enable no-console */
}
/**
* Retrieve all metadata from the specified business unit into the local file system.
*
Expand All @@ -185,6 +214,7 @@ class Mcdev {
* @returns {Promise.<object>} -
*/
static async retrieve(businessUnit, selectedTypesArr, keys, changelogOnly) {
this.#welcomeMessage();
console.time('Time'); // eslint-disable-line no-console
Util.startLogger();
Util.logger.info('mcdev:: Retrieve');
Expand Down Expand Up @@ -421,6 +451,7 @@ class Mcdev {
* @returns {Promise.<Object.<string, MultiMetadataTypeMap>>} deployed metadata per BU (first key: bu name, second key: metadata type)
*/
static async deploy(businessUnit, selectedTypesArr, keyArr) {
this.#welcomeMessage();
console.time('Time'); // eslint-disable-line no-console
Util.startLogger();
const deployResult = await Deployer.deploy(businessUnit, selectedTypesArr, keyArr);
Expand Down

0 comments on commit 0cbd5b9

Please sign in to comment.