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

Refactor/clean create astro logs #3212

Merged
merged 4 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-cobras-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

Simplify logging during welcome message and directory selection
8 changes: 1 addition & 7 deletions packages/create-astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.' });

Expand All @@ -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) });
Expand Down
2 changes: 1 addition & 1 deletion packages/create-astro/test/directory-step.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down