diff options
author | Michael Gattozzi <mgattozzi@gmail.com> | 2020-01-01 22:54:34 -0500 |
---|---|---|
committer | Michael Gattozzi <mgattozzi@gmail.com> | 2020-01-01 22:54:34 -0500 |
commit | 86efa907288199acf7bb11ea3f426b18b230a4bd (patch) | |
tree | 6387d282c9a3c522d5c0d08ebf1d26bc5defc33b /.dev-suite/hooked/wrapper/pre-rebase.sh | |
parent | ed345b6583684738975e3bf8a7e0c041df0123ab (diff) |
Make hooked and dev-suite git hooks cross platform
Up to this point hooked had been only designed to work on Windows, not
because dev-suite didn't want to support it, but because doing so was an
immense amount of work with no clear design due to how Unix and Window
paths are not at all the same. While shebang notation works on them for
both the paths are different.
In order to get around this we wrap Ruby, Python, and Bash scripts on
Windows with a different script that invokes the 'Git for Windows'
sh.exe to run the actual interpreters on the script. These can work fine
then as long as one has installed Git for Windows on their machine, and
has a copy of py.exe or ruby.exe on their path to be invoked.
There is one caveat. We have to assume that a user has installed their
copy of Git for Windows in the default location. This means if they
haven't the scripts will fail to run. There's not much we can do about
this and it's just a necessary wart to provide cross platform
capabilities for a project.
All projects can be initialized now with one of the language choices and
then have the proper files linked on their OS as part of the
initialization. Those who need to just link them in an already existing
project can just run `hooked link` in order to set their computer up.
This again handles the differences between the platforms. This project
is also updated to the new format of hooked so that collaboration is now
not limited to just Unix based OSes.
Diffstat (limited to '.dev-suite/hooked/wrapper/pre-rebase.sh')
-rwxr-xr-x | .dev-suite/hooked/wrapper/pre-rebase.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/.dev-suite/hooked/wrapper/pre-rebase.sh b/.dev-suite/hooked/wrapper/pre-rebase.sh new file mode 100755 index 0000000..642be35 --- /dev/null +++ b/.dev-suite/hooked/wrapper/pre-rebase.sh @@ -0,0 +1,2 @@ +#!C:\Program Files\Git\bin\sh.exe +py.exe .dev-suite/hooked/pre-rebase.py |