Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/1200 show dedicated messages to accenture and non-accenture users #1262

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
Loading