From 00fc1326ed526974cc4aca9faec410df91b4bcbd Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Tue, 26 Apr 2022 20:38:31 -0400 Subject: [PATCH] Refactor/clean create astro logs (#3212) * refactor: simplify dir error log to avoid wrapped text * refactor: remove redundant "issue" callout * chore: changeset * chore: update tests for new dir log --- .changeset/curly-cobras-kneel.md | 5 +++++ packages/create-astro/src/index.ts | 8 +------- packages/create-astro/test/directory-step.test.js | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 .changeset/curly-cobras-kneel.md diff --git a/.changeset/curly-cobras-kneel.md b/.changeset/curly-cobras-kneel.md new file mode 100644 index 000000000..d45af83e3 --- /dev/null +++ b/.changeset/curly-cobras-kneel.md @@ -0,0 +1,5 @@ +--- +'create-astro': patch +--- + +Simplify logging during welcome message and directory selection diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index 80b3b4fd1..a6cedeb86 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -45,11 +45,6 @@ export async function main() { logger.debug('Verbose logging turned on'); console.log(`\n${bold('Welcome to Astro!')} ${gray(`(create-astro v${version})`)}`); - console.log( - `If you encounter a problem, visit ${cyan( - 'https://github.com/withastro/astro/issues' - )} to search or file a new issue.\n` - ); let spinner = ora({ color: 'green', text: 'Prepare for liftoff.' }); @@ -66,8 +61,7 @@ export async function main() { } if (!cwd || !isEmpty(cwd)) { - const notEmptyMsg = (dirPath: string) => - `"${bold(dirPath)}" is not empty. Please clear contents or choose a different path.`; + const notEmptyMsg = (dirPath: string) => `"${bold(dirPath)}" is not empty!`; if (!isEmpty(cwd)) { let rejectProjectDir = ora({ color: 'red', text: notEmptyMsg(cwd) }); diff --git a/packages/create-astro/test/directory-step.test.js b/packages/create-astro/test/directory-step.test.js index 02ddc672a..7193fe298 100644 --- a/packages/create-astro/test/directory-step.test.js +++ b/packages/create-astro/test/directory-step.test.js @@ -58,7 +58,7 @@ describe('[create-astro] select directory', function () { return promiseWithTimeout((resolve) => { const { stdout, stdin } = setup(); stdout.on('data', (chunk) => { - if (chunk.includes('Please clear contents or choose a different path.')) { + if (chunk.includes('is not empty!')) { resolve(); } if (chunk.includes(PROMPT_MESSAGES.directory)) {