shell error in husky's post-checkout script
iamstarkov opened this issue Β· comments
Vladimir Starkov commented
First of all, thank you for sharing this tip on React Europe this year. It is a real life saver.
I started to use it in my hobby project. Everything is quite smooth, but sometimes I'm getting this error:
~/projects/oss/topics-manager fix/56-oauth-csrf
β― git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
husky > post-checkout (node v10.16.0)
yarn install v1.16.0
[1/5] π Validating package.json...
[2/5] π Resolving packages...
[3/5] π Fetching packages...
[4/5] π Linking dependencies...
[5/5] π¨ Building fresh packages...
β¨ Done in 11.28s.
.git/hooks/post-checkout: line 49: syntax error near unexpected token `fi'
.git/hooks/post-checkout: line 49: `fi'
Im not really good at bash/shell, but afaik if syntax looks like if test-commands; then commands; fi
then it should work, so im a little bit confused.
Some debug info on (MacOS Mojave 10.14.5):
β― node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
Node.js v10.16.0
darwin 18.6.0
β― yarn -v
1.16.0
β― cat yarn.lock | grep "husky@"
husky@2.5.0:
Do you know if I've done anything wrong? Or maybe you might know what I should google or read some more specific documentation?
Paul Armstrong commented
Please file this with husky
Vladimir Starkov commented
alright