run-if-diff
Run a command if files have changed.
Last updated 7 months ago by jameslnewell .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install run-if-diff 
SYNC missed versions from official npm registry.

run-if-diff

satay Travis

Run a command if files are different.

Installation

yarn add run-if-diff

Usage

run-if-diff

run-if-diff [--since <ref>] [--file <glob>] -- <cmd>

Example:

run-if-diff --since v1.3.1 --file my-app.yml -- aws cfn deploy --stack-name my-app --template-file my-app.yml

exit-if-diff

exit-if-diff [--since <ref>] [--file <glob>]

Example:

exit-if-diff --since v1.3.1 --file my-app.yml
if [ $? -ne 0 ]
  aws cfn deploy --stack-name my-app --template-file my-app.yml
fi

CLI

run-if-diff

Run a command if files have changed.

Options

--since

The git ref to compare files in the current working directory to. Defaults to the most recent tag or the initial commit.

--file

A file or a glob that must be different for the command to be run.

If you specify multiple --file options, the command will run if any of the --file options are matched.

exit-if-diff

Exit with code 128 if files have changed and with code 0 otherwise.

Options

--since

The git ref to compare files in the current working directory to. Defaults to the most recent tag or the initial commit.

--file

A file or a glob that must be different for the command to exit.

If you specify multiple --file options, the command will exit if any of the --file options are matched.

Credits

Inspired by lerna's --since filter.

License

Copyright 2018 James Newell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 2.0.1                                ...           latest (7 months ago)

8 Versions

  • 2.0.1                                ...           7 months ago
  • 2.0.0                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 10
Dependencies (6)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |