Skip to content

Commit

Permalink
chore: wrap the projectDir in quotes if it contains spaces (#6594)
Browse files Browse the repository at this point in the history
* chore: wrap the projectDir in quotes if it contains spaces

* chore: add changeset

* fix: update output projectDir

* Update .changeset/tall-beans-own.md

Co-authored-by: Bjorn Lu <[email protected]>

---------

Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
btea and bluwy authored Mar 21, 2023
1 parent f112c12 commit a661907
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tall-beans-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

wrap projecDir in quptes if it contains spaces
3 changes: 2 additions & 1 deletion packages/create-astro/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ export const nextSteps = async ({ projectDir, devCmd }: { projectDir: string; de

await sleep(100);
if (projectDir !== '') {
projectDir = projectDir.includes(' ') ? `"./${projectDir}"` : `./${projectDir}`;
const enter = [
`\n${prefix}Enter your project directory using`,
color.cyan(`cd ./${projectDir}`, ''),
color.cyan(`cd ${projectDir}`, ''),
];
const len = enter[0].length + stripAnsi(enter[1]).length;
log(enter.join(len > max ? '\n' + prefix : ' '));
Expand Down

0 comments on commit a661907

Please sign in to comment.