3.1.2 • Published 3 years ago

graceful-git v3.1.2

Weekly downloads
1,444
License
MIT
Repository
-
Last release
3 years ago

graceful-git

Executes Git commands gracefully. Retries on errors

Git is called by absolute path to avoid binary planting attacks on Windows.

npm version

Installation

<npm|yarn|pnpm> add graceful-git

Usage

'use strict'
const gracefulGit = require('graceful-git')

gracefulGit(['status', 'README.md'])
  .then(result => console.log(result.stdout))
  .catch(err => console.error(err))
  //> On branch master
  //  Your branch is based on 'origin/master', but the upstream is gone.
  //    (use "git branch --unset-upstream" to fixup)
  //  nothing to commit, working directory clean

API

git(args, [opts]) => Promise

Arguments:

  • args - string[] - arguments passed to the Git CLI
  • opts.cwd - Path - the directory in which the Git command should be executed
  • ...opts - object - optional. Parameters used by retry when git operation fails.

git.noRetry(args, [opts]) => Promise

Same as git() but without retries.

License

MIT © Zoltan Kochan

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.2

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago