safe-add-commit-changes

1.0.1 • Public • Published

safe-add-commit-changes

git diff-index isn't enough sometimes. Espescially if you want to optimistically generate code then add and commit it in automation steps. This function lets us safely add and commit changes whether changes were made or not.

Install

yarn add -D safe-add-commit-changes
# or 
npm i safe-add-commit-changes --save-dev 

Documentation

Table of Contents

safeAddCommitChanges

safeAddCommitChanges

Parameters

  • fileTypes string what to git add - can be glob or type of files {snapshots|docs|tests|js} + more if custom patterns provided
  • logger Object a logger object with error and info methods (optional, default console)
  • patterns Object a js object with key value pairs of pattern for additional fileType to path definitions (optional, default {})

Examples

<caption>Ex cli usage:
$ safeAddCommit docs
$ safeAddCommit snapshots
$ safeAddCommit src/*,js

Returns Promise resolves a success or failure to add changes

Package Sidebar

Install

npm i safe-add-commit-changes

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

5.56 kB

Total Files

6

Last publish

Collaborators

  • davidedaniel