RFC: `lake init` should warn when run inside non-empty directory
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Proposal
Right now, it is very easy to accidentally write lake init my-project instead of lake new my-project which will put a lot of file into whatevery directory you're currently in (for example projects/ folder).
I claim that wanting to run lake init in a non-empty directory is rare enough to justify asking Current directory is non-empty. Proceed creating a Lean package here? (Y/n) on the command line.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the command-line handling for lake init and compare it with lake new, as described in the proposal. Check how directory contents are detected and how command-line prompts are tested. Done means lake init asks for confirmation in a non-empty directory while preserving the existing behavior for empty directories.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100