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

[ Feat ] Windows Support #33

Merged
merged 4 commits into from
Jul 30, 2023
Merged

Conversation

gpibarra
Copy link
Contributor

@gpibarra gpibarra commented Jul 29, 2023

Resolves #14

Step to reproduce

# current folder: c:\Users\gibarra\develop
# clone repo
git clone https://github.com/ProjektGopher/whisky.git
cd whisky
# install dependences
composer install

# install hook of this repo (linter-pint, stan and test)
php whisky install -n

# check files create
# ls ./.git/hooks
dir .\.git\hooks

# here, files was created

# check content
# cat ./.git/hooks/pre-commit
type .\.git\hooks\pre-commit

# here is the problem, this file use "\" instead of "/" and in windows this is a problem because not escape the character
# the solution is change "\" to "/" (or "\\" to "\") in the files

#####
# confirm error by running pre-commit hook 
git hook run pre-commit
# error
# .git/hooks/pre-commit: line 2: C:Usersgibarradevelopwhiskywhisky: command not found

Changes in files generated

File: ..git\hooks\pre-commit

#!/bin/sh
- eval "$(C:\Users\gibarra\develop\whisky\whisky get-run-cmd pre-push)"
+ eval "$(C:/Users/gibarra/develop/whisky/whisky get-run-cmd pre-push)"

@gpibarra
Copy link
Contributor Author

The method is implemented the same as app/Platform.php .
The same method could be called when that PR is merged.
This change in the routes gave me problems with the file mook where the shouldReceive function did not recognize it the same because the parameter is not the same.

PS: Sorry for my English

@ProjektGopher
Copy link
Owner

This is super helpful work! Thx for taking the time to contribute! I'm at the park with my daughter right now so I can't fully review and test it out, but I'll take a closer look later on tonight. I'm super excited to finally get this issue fixed.

Repository owner deleted a comment from gpibarra Jul 30, 2023
@ProjektGopher ProjektGopher changed the title Hooks win [ Feat ] Windows Support Jul 30, 2023
@ProjektGopher ProjektGopher merged commit 07a4a12 into ProjektGopher:main Jul 30, 2023
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.

[Windows Support] Run hook - bad path
2 participants