Automate tasks that happen on when you pull in new code.
{
"scripts": {
"postcheckout": "pull-lock"
},
"pull-lock": {
"yarn.lock": "yarn install",
"Example/Podfile.lock": ["cd Example", "bundle exec pod install"]
}
}
Like lint-staged for when you've git pull
ed. You set up a
husky "postcheckout"
hook which is passed to the CLI tool pull-lock
.
pull-lock
will then compare the changedfiles to the config and execute commands for you automatically.
yarn add --dev pull-lock husky
- Update your
package.json
like this:
{
"scripts": {
+ "postcheckout": "pull-lock"
},
+ "pull-lock": {
+ "yarn.lock": "yarn install",
+ }
}
Then when you run a git pull
, pull-lock
will check for yarn.lock
inside the diffed files and run the
scripts inside your config files.
As pull-lock uses cosmic-config you can leave your app settings in either:
- a
pull-lock
object in yourpackage.json
- a
.pulllockrc
file in JSON or YML format - a
pull-lock.config.js
file in JS format