1.0.1 • Published 5 years ago

safe-add-commit-changes v1.0.1

Weekly downloads
43
License
MIT
Repository
github
Last release
5 years ago

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