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

Cannot clone repo on Windows #16

Open
lorengordon opened this issue Jun 18, 2016 · 3 comments
Open

Cannot clone repo on Windows #16

lorengordon opened this issue Jun 18, 2016 · 3 comments

Comments

@lorengordon
Copy link

lorengordon commented Jun 18, 2016

I was attempting to work with this cookiecutter on a Windows machine, but cloning the repo fails because of the templated directories and filenames containing the | character. That is an invalid character for directories and filenames on Windows.

I checked the commit history to try to figure out why those are being templated, but it wasn't really clear to me. Is there perhaps an alternate way to fix whatever the problem was?

C:\Users\Loren\.cookiecutters> git clone https://github.com/robinandeer/cookiecutter-pyvanguard.git
Cloning into 'cookiecutter-pyvanguard'...
remote: Counting objects: 648, done.
remote: Total 648 (delta 0), reused 0 (delta 0), pack-reused 648
Receiving objects: 100% (648/648), 193.15 KiB | 0 bytes/s, done.
Resolving deltas: 100% (339/339), done.
Checking connectivity... done.
error: unable to create file {{cookiecutter.repo_name}}/tests/test_{{ cookiecutter.repo_name|replace("-", "_") }}.py (Invalid argument)
fatal: cannot create directory at '{{cookiecutter.repo_name}}/{{cookiecutter.repo_name|replace("-", "_")}}': Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
@lorengordon
Copy link
Author

lorengordon commented Jun 18, 2016

Ahh, perhaps just tell the user that - is an invalid character and exit, the way cookiecutter-pypackage does?

https://github.com/audreyr/cookiecutter-pypackage/blob/master/hooks/pre_gen_project.py

@lorengordon
Copy link
Author

Another option that looks to be working is to use the .replace() notation rather than | replace. Noticed this in the cookiecutter-pylibrary project...

@robinandeer
Copy link
Owner

okey interesting - didn't know about the hooks! I can look into that :)

If you want to submit a PR I will happily look it over! Otherwise when I have time ;)

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

2 participants