1.1.1 • Published 4 years ago
diff-run v1.1.1
Diff Run
run command after file reversion change, use with
post-mergehook
Usage
Install
npm i diff-runUse with husky
- create
post-mergeinhuskyconfig directory - add script into
post-merge
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx diff-runFYI, add
--no-autoflag will disable auto-run
Config
support all configurations which support by cosmiconfig
diffruninpackage.json
{
"diffrun": {
"package-lock.json": "npm ci"
}
}- a JSON or YAML, extensionless "rc file", such as
.diffrunrc
{
"package-lock.json": "npm ci"
}- an "rc file" with the extensions .json, .yaml, .yml, .js, or .cjs, such as
diffrunrc.json
{
"package-lock.json": "npm ci"
}- a
diffrun.config.jsordiffrun.config.cjsCommonJS module
module.exports = {
'package-lock.json': ['npm ci'],
}config in Array will be executed in order. Otherwise, it will be executed concurrently
- In Order
// this will be executed in order
module.exports = [
{
'package.json': ['npm ci'],
},
{
'.eslintrc.js': 'npx eslint .',
},
]- Concurrently
// this will be executed concurrently
module.exports = {
'package.json': ['npm ci'],
'.eslintrc.js': 'npx eslint .',
}