graceful-git
Advanced tools
Comparing version 1.0.3 to 2.0.0
@@ -15,6 +15,7 @@ 'use strict' | ||
module.exports = (args, opts) => { | ||
opts = opts || {} | ||
const operation = retry.operation(Object.assign({}, RETRY_OPTIONS, opts)) | ||
return new Promise((resolve, reject) => { | ||
operation.attempt(currentAttempt => { | ||
execGit(args) | ||
execGit(args, {cwd: opts.cwd || process.cwd()}) | ||
.then(resolve) | ||
@@ -21,0 +22,0 @@ .catch(err => { |
{ | ||
"name": "graceful-git", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "Executes git commands gracefully. Retries them on errors", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=6" | ||
}, | ||
@@ -45,3 +45,3 @@ "scripts": { | ||
"dependencies": { | ||
"execa": "^0.10.0", | ||
"execa": "^1.0.0", | ||
"retry": "^0.12.0" | ||
@@ -48,0 +48,0 @@ }, |
@@ -34,3 +34,3 @@ # graceful-git | ||
### `git(args, [retryOptions]) => Promise` | ||
### `git(args, [opts]) => Promise` | ||
@@ -40,3 +40,4 @@ **Arguments:** | ||
- `args` - _string\[]_ - arguments passed to the Git CLI | ||
- `retryOptions` - _object_ - optional. Parameters used by [retry](https://www.npmjs.com/package/retry) when git operation fails. | ||
- `opts.cwd` - _Path_ - the directory in which the Git command should be executed | ||
- `...opts` - _object_ - optional. Parameters used by [retry](https://www.npmjs.com/package/retry) when git operation fails. | ||
@@ -43,0 +44,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4033
26
45
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@1.0.0(transitive)
+ Addedget-stream@4.1.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedexeca@0.10.0(transitive)
- Removedget-stream@3.0.0(transitive)
Updatedexeca@^1.0.0