Skip to content

fix: support scaffolding into current directory with .#403

Merged
technophile-04 merged 2 commits intomainfrom
fix/create-eth-dot
Mar 20, 2026
Merged

fix: support scaffolding into current directory with .#403
technophile-04 merged 2 commits intomainfrom
fix/create-eth-dot

Conversation

@technophile-04
Copy link
Copy Markdown
Collaborator

Summary

Closes #402

  • npx create-eth . now scaffolds into the current directory instead of failing with mkdir: .: File exists
  • If the directory is not empty, it throws a clear error: Directory /path is not empty
  • Skips the cd . instruction in the outro message when . is used

How it works

When the target directory already exists (e.g. .), we skip mkdir and instead check if the directory is empty. If it contains any files, we error out to prevent overwriting existing projects.

This follows the same approach as create-next-app, which also supports . as the project path and checks for an empty directory before proceeding.

Test plan

  • create-eth . in an empty directory → scaffolds successfully
  • create-eth . in a non-empty directory → errors with "Directory is not empty"
  • create-eth my-project → works as before (unchanged path)

🤖 Generated with Claude Code

Copy link
Copy Markdown
Member

@rin-st rin-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to test with empty . folder without release, but all other cases works well, especially installing to random empty folder which I think is almost the same as empty . folder

@technophile-04 technophile-04 merged commit ac2b0b7 into main Mar 20, 2026
7 checks passed
@technophile-04 technophile-04 deleted the fix/create-eth-dot branch March 20, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npx create-eth . fails

2 participants