paularmstrong / monorepo-ts

A git repo template for setting up TypeScript Monorepos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shell error in husky's post-checkout script

iamstarkov opened this issue Β· comments

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?

Please file this with husky

alright