changed-only
v1.0.1
Published
Execute a command on git changed files
Downloads
4
Readme
changed-only
Find files that have been changed in git and passes their paths to a specified
command, similar to the xargs
utility.
changed-only [--all=<env>] [--track=<ref>] [<patterns>] -- <command> [<args>]
Examples:
changed-only --track=master '**/*.js' -- eslint --fix
execute eslint for all .js files that have diverged from the master
branch
changed-only --track=main '**/*.ts' '!index.ts'
prints a list of .ts files that have diverged from the main
branch, but never
index.ts
changed-only -- prettier --write
executes prettier for all changed files
changed-only --all=CI -- prettier --check
executes prettier for all changed files, or against all tracked files if the CI environment variable exists.