dnaka91 / cargo-hatch

Hatch new projects like a chick coming out of its egg
GNU Affero General Public License v3.0
7 stars 1 forks source link

Only allow using the current path if empty or explicitly specified #4

Closed ModProg closed 1 year ago

ModProg commented 2 years ago

I just created the project in my parent directory by accident.

I think there is a reason many tools only allow using an existing directory if it is empty.

Maybe a compromise could be to either ask "Are you sure you want to hatch in this non empty directory direcotry_name?" or require passing the current directory as . .

I hope I don't anoy you too much with these issues. It's a great tool, and I really enjoy using it.

dnaka91 commented 2 years ago

That's funny, I was thinking exactly the same when I was testing out my implementation of your previous feature request. Then wanted to just implement it and realized, I already have a check for the target directory, but it has a bug.

Fix that now, so you won't be able to generate into a non-empty directory (but if it already exists and is empty, it's okay).

Will modify this further and add a prompt that lets you choose interactively. So you can either cancel or force generate, which would wipe the folder beforehand.

I hope I don't anoy you too much with these issues. It's a great tool, and I really enjoy using it.

NOT AT ALL! I'm really happy to get the issues and feature requests from you! That are good ideas, and it just makes my little tool better and better.

ModProg commented 1 year ago

I beleave this is fixed