ddddavidmartin / Pre-commit-hooks

A set of useful (and documented!) git pre-commit hooks.
BSD 2-Clause "Simplified" License
101 stars 30 forks source link

Added Support for Directory with Spaces in Name #2

Closed RoLYroLLs closed 10 years ago

RoLYroLLs commented 10 years ago

Using this script in a windows environment I found issues when it was located in a path that contained spaces. I'm not sure if this is the best way to fix this as I'm not familar with bash scripting but after Google'ing around and many tests I found this to work.

ddddavidmartin commented 10 years ago

Hah, yes, making shell scripts robust against whitespaces can be quite a challenge. Consistently quoting variables often seems to do the trick though. So yes, this should be the right way to fix it.

Thank you very much reporting and fixing this issue! I will try to reproduce it and merge it then.

ddddavidmartin commented 10 years ago

I had a look and there are a couple more lines where we have to quote variables. The other hooks currently break as well in directories with whitespaces. I'm not sure what the best procedure is, but I will merge your changes and then update the rest of the files.

RoLYroLLs commented 10 years ago

Awesome! Glad I could help, even just a little.

ddddavidmartin commented 10 years ago

Yup, I appreciate any input and help!