hatch icon indicating copy to clipboard operation
hatch copied to clipboard

New project creation only possible in empty directories

Open lfleck opened this issue 1 year ago • 4 comments

hatch new my-project currently requires an empty directory. However, some workspaces may already contain files like a .devcontainer.json or the .git directory when starting the new project by cloning an empty remote repository. While hatch --init can deal with this, it does not provide all features like creating the src-layout. Is there a workaround to apply a project template to non-empty directories?

lfleck avatar May 13 '24 08:05 lfleck

Does it work if you do hatch new project .?

ofek avatar May 13 '24 20:05 ofek

Unfortunately not. This also raises the "Directory ... is not empty" error.

lfleck avatar May 13 '24 21:05 lfleck

I'm totally open to someone adding a -f/--force flag!

ofek avatar May 13 '24 21:05 ofek

I'm encountering the same issue, and it has significantly impacted my first impression of this tool in a negative way.

NPM tools make it possible as npm init or npm -i and it's necessary we usually create a new git managed project on GitHub, then git clone to the local directory.

ken-okabe avatar Aug 12 '24 20:08 ken-okabe