Skip to content

Conversation

wadabum
Copy link
Contributor

@wadabum wadabum commented Aug 18, 2025

just a few small tweaks to be able to run the tests on windows (while being configured for using git-bash.exe)

makes

git clone https://github.com/andrewmcwattersandco/git-fetch-file.git
git config --global alias.fetch-file '!py '"$(realpath git-fetch-file/git-fetch-file.py)"

act correctly

also results in a nice

C:\Python\Python313\python.exe "C:/Program Files/JetBrains/PyCharm 2025.2.0.1/plugins/python-ce/helpers/pycharm/_jb_unittest_runner.py" --path C:\dev\git-fetch-file\test_git_fetch_file.py 
Testing started at X:YZ PM ...
Launching unittests with arguments python -m unittest C:\dev\git-fetch-file\test_git_fetch_file.py in C:\dev\git-fetch-file

Initialized empty Git repository in C:/Users/Administrator/AppData/Local/Temp/1/tmp7hmj7256/.git/
Added file README from https://github.com/octocat/Hello-World.git (On branch master at 7fd1a60)
Initialized empty Git repository in C:/Users/Administrator/AppData/Local/Temp/1/tmpsmhasrok/.git/
Added file README from https://github.com/octocat/Hello-World.git (On branch master at 7fd1a60)
Fetched README -> README at 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d


Ran 3 tests in 3.129s

OK

Process finished with exit code 0

And while the script_path "[1]+':'+[2:]" drive-letter hack is not the cleanest, it should work for everything it may encounter
(and saves on an extra subshell to call cygpath :D )

while on windows, user may configure his git-alias as "!python /c/some/path.py"
windows wont let you delete the folder you are in (the tmp)
@wadabum wadabum mentioned this pull request Aug 18, 2025
@andrewmcwatters
Copy link
Contributor

I will add you to the contributors list on the README.md. Thank you for your contribution!

@andrewmcwatters andrewmcwatters merged commit 3d6152d into andrewmcwattersandco:main Aug 18, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants