Print normalized list of git status files for command line usage.
$ git status -s
# Output:
$ M README.md
$ M src/index.js
$ ?? src/index.spec.js
$ git-print
# Output:
$ /path/to/README.md /path/to/src/index.js /path/to/src/index.spec.js
yarn
$ yarn add git-print --dev
npm
$ npm install git-print --save-dev
$ git-print [OPTIONS]
When there are no changes in the current git repository, git-print
exits with status code 1
instead of printing an
empty file list. This allows for streamlined conditional chaining with other commands.
Default: ./
Provide a custom execution path.
Default: true
Toggle listing of files with status deleted
.
Default: true
Toggle listing of staged
files.
Default: true
Shorthand option for listing of staged
files only.
This option makes the output suitable for processing with linting and formatting tools.
Same as manually specifying options:
--staged=true \
--deleted=false \
--unstaged=false \
--untracked=false
Default: true
Toggle listing of unstaged
files.
Default: true
Toggle listing of untracked
files.
Run Prettier formatting on staged files, or format the current directory when no files are staged.
package.json:
{
"scripts": {
"prettier": "yarn prettier --write $(git-print --staged-only || printf '.')"
}
}
Clone this repository and execute:
$ yarn install && yarn run bootstrap
See the list of available commands:
$ yarn run
- Install editor SDKs for Yarn Plug'n'Play installs.
- Execute
yarn dev
to start the local development environment.
See the releases page.
List of similar projects with API usage: