run command after git merge
npm install diff-run> run command after file reversion change, use with post-merge hook




``bash`
npm i diff-run
- create post-merge in husky config directorypost-merge
- add script into
`sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx diff-run
`
> FYI, add --no-auto flag will disable auto-run
support all configurations which support by cosmiconfig
- diffrun in package.json
`json`
{
"diffrun": {
"package-lock.json": "npm ci"
}
}
- a JSON or YAML, extensionless "rc file", such as .diffrunrc
`json`
{
"package-lock.json": "npm ci"
}
- an "rc file" with the extensions .json, .yaml, .yml, .js, or .cjs, such as diffrunrc.json
`json`
{
"package-lock.json": "npm ci"
}
- a diffrun.config.js or diffrun.config.cjs CommonJS module
`javascript`
module.exports = {
'package-lock.json': ['npm ci'],
}
config in Array will be executed in order. Otherwise, it will be executed concurrently
- In Order
`javascript`
// this will be executed in order
module.exports = [
{
'package.json': ['npm ci'],
},
{
'.eslintrc.js': 'npx eslint .',
},
]
- Concurrently
`javascript``
// this will be executed concurrently
module.exports = {
'package.json': ['npm ci'],
'.eslintrc.js': 'npx eslint .',
}