Skip to content

Instantly share code, notes, and snippets.

@reime005
Last active February 11, 2021 03:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/4802c1b8de7b873dcd0f5d6175697218 to your computer and use it in GitHub Desktop.
Save reime005/4802c1b8de7b873dcd0f5d6175697218 to your computer and use it in GitHub Desktop.
Husky Configuration File
const runYarnLock = 'yarn install --frozen-lockfile';
module.exports = {
hooks: {
'post-checkout': `if [[ $HUSKY_GIT_PARAMS =~ 1$ ]]; then ${runYarnLock}; fi`,
'post-merge': runYarnLock,
'post-rebase': 'yarn install',
'pre-commit': 'yarn test && yarn lint-staged'
}
};
@praveeno
Copy link

--frozen-lickfile should be --frozen-lockfile

@reime005
Copy link
Author

--frozen-lickfile should be --frozen-lockfile

thx

@budarin
Copy link

budarin commented Feb 10, 2021

--frozen-lickfile should be --frozen-lockfile

thx

husky v5 has changed a way to pass params into hook: instead of passing $HUSKY_GIT_PARAMS they pass every parameter in their variable $1 $2 ...
how tho change script for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment