Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init current directory #36

Open
jayvdb opened this issue Dec 30, 2019 · 0 comments
Open

Init current directory #36

jayvdb opened this issue Dec 30, 2019 · 0 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Dec 30, 2019

My new project creation workflow is usually

$ cd projects
$ mkdir -p foo/foo
$ cd foo
$ vi foo/__init__.py
$ mkdir tests
$ vi tests/test_foo.py
$ pytest
... iterate ...
$ git init

I then want to create all the project junk, after I know what I am building.

As noted above, git init works on the current directory.

Tools like https://pypi.org/project/via/ and https://pypi.org/project/gitinit/ do the same.

$ via -i python -l mit
$ ls -a
.  ..  .gitignore  LICENSE
$ rm .gitignore LICENSE
$ gitinit -l python
Initialized empty Git repository in /home/jayvdb/projects/foo/.git/
Creating .gitignore ...
$ ls -a
.  ..  .git  .gitignore

Of course there are many other projects like cookiecutter which work like yehua's current 'new project directory' mode. Note that cookiecutter -o . doesnt create the files in the local directory - it creates a subdir in the local directory.

But why not allow both... ;-)

One 'easy' way to add this mode would be to allow yehua . to indicate use the current directory, or add more args (--current-dir or --in-place?) to override the current 'new project directory' mode.

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

No branches or pull requests

1 participant