Install breaks if ~ in core.excludesfile
ovidner opened this issue · comments
Olle Vidner commented
Steps to reproduce:
- Use Windows. (This step might not be mandatory)
- Store your global ignores in e.g.
~/.gitignore_global
. - Point to your global ignores using
core.excludesfile=~/.gitignore_global
in git config. The tilde is the important part here. - Run
git xl install
.
Expected behaviour
Installations succeeds. :)
Actual behaviour
[...] Failed to execute script cli
Traceback (most recent call last):
File "cli.py", line 344, in <module>
File "cli.py", line 260, in execute
File "cli.py", line 295, in install
File "cli.py", line 82, in install
File "cli.py", line 176, in update_git_file
FileNotFoundError: [Errno 2] No such file or directory: '~/.gitignore_global'
Possible cause
- https://github.com/xlwings/git-xl/blob/master/src/cli.py#L176
- "Unlike a unix shell, Python does not do any automatic path expansions." (https://docs.python.org/3.7/library/os.path.html)
Possible solution
Use os.path.expanduser
for the gitignore path.
MatthewRClarke commented
Same issue. Gonna see if I can fix it now
MatthewRClarke commented
#47 is open
Felix Zumstein commented
released in 0.4.1