Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
- visormatt
- weavdale
- wladiston
- XiNiHa
- xstevenyung
- yauri-io
- yesmeck
Expand Down
21 changes: 4 additions & 17 deletions packages/remix-dev/cli/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,25 +368,12 @@ export async function validateNewProjectPath(input: string): Promise<void> {
let projectDir = path.resolve(cwd, input);
if (
(await fse.pathExists(projectDir)) &&
(await fse.stat(projectDir)).isDirectory()
) {
let contents = await fse.readdir(projectDir);
if (contents.length > 0) {
throw Error(
"🚨 The current directory must be empty to create a new project. Please " +
"clear the contents of the directory or choose a different path."
);
}
return;
}

if (
(await fse.pathExists(projectDir)) &&
(await fse.stat(projectDir)).isDirectory()
(await fse.stat(projectDir)).isDirectory() &&
(await fse.readdir(projectDir)).length > 0
) {
throw Error(
"🚨 The directory provided already exists. Please try again with a " +
"different directory."
"🚨 The current directory must be empty to create a new project. Please " +
"clear the contents of the directory or choose a different path."
);
}
}
Expand Down