diff --git a/src/lib/baseCommand.ts b/src/lib/baseCommand.ts index 03b4a4207..2b361ce71 100644 --- a/src/lib/baseCommand.ts +++ b/src/lib/baseCommand.ts @@ -102,7 +102,7 @@ export default class Command { )} is currently logged in, using the stored API key for this project: ${chalk.blue( configstore.get('project') )}`, - false + { includeEmojiPrefix: false } ); } @@ -110,9 +110,9 @@ export default class Command { if (isCI()) { throw new Error('No project API key provided. Please use `--key`.'); } - info("Looks like you're missing a ReadMe API key, let's fix that! šŸ¦‰", false); + info("Looks like you're missing a ReadMe API key, let's fix that! šŸ¦‰", { includeEmojiPrefix: false }); const result = await loginFlow(); - info(result, false); + info(result, { includeEmojiPrefix: false }); // eslint-disable-next-line no-param-reassign opts.key = configstore.get('apiKey'); } diff --git a/src/lib/createGHA/index.ts b/src/lib/createGHA/index.ts index 588a7b330..e9472eaa8 100644 --- a/src/lib/createGHA/index.ts +++ b/src/lib/createGHA/index.ts @@ -188,10 +188,10 @@ export default async function createGHA( } } - if (msg) info(msg, false); + if (msg) info(msg, { includeEmojiPrefix: false }); if (opts.github) { - info(chalk.bold("\nšŸš€ Let's get you set up with GitHub Actions! šŸš€\n"), false); + info(chalk.bold("\nšŸš€ Let's get you set up with GitHub Actions! šŸš€\n"), { includeEmojiPrefix: false }); } else { info( [ @@ -205,7 +205,7 @@ export default async function createGHA( `āœØ This means it will run ${chalk.italic('automagically')} with every push to a branch of your choice!`, '', ].join('\n'), - false + { includeEmojiPrefix: false } ); } diff --git a/src/lib/logger.ts b/src/lib/logger.ts index f4e3d40e3..b2e2cdc69 100644 --- a/src/lib/logger.ts +++ b/src/lib/logger.ts @@ -31,14 +31,19 @@ function error(input: string) { /** * Wrapper for info/notice statements. - * @param {Boolean} includeEmojiPrefix whether or not to prefix - * the statement with this emoji: ā„¹ļø + */ -function info(input: string, includeEmojiPrefix = true) { +function info( + input: string, + opts = { + /** whether or not to prefix * the statement with this emoji: ā„¹ļø */ + includeEmojiPrefix: true, + } +) { /* istanbul ignore next */ if (isGHA() && !isTest()) return core.notice(input); /* istanbul ignore next */ - if (!includeEmojiPrefix) return console.info(input); // eslint-disable-line no-console + if (!opts.includeEmojiPrefix) return console.info(input); // eslint-disable-line no-console // eslint-disable-next-line no-console return console.info(`ā„¹ļø ${input}`); }