Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graceful-git

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graceful-git - npm Package Compare versions

Comparing version 3.0.2 to 3.1.0

17

index.js
'use strict'
const which = require('@zkochan/which');
const execa = require('execa')
const retry = require('retry')
const execGit = execa.bind(null, 'git')
let gitLocation

@@ -14,3 +15,6 @@ const RETRY_OPTIONS = {

module.exports = (args, opts) => {
module.exports = gracefulGit
module.exports.noRetry = noRetry
async function gracefulGit (args, opts) {
opts = opts || {}

@@ -20,4 +24,3 @@ const operation = retry.operation(Object.assign({}, RETRY_OPTIONS, opts))

operation.attempt(currentAttempt => {
execGit(args, {cwd: opts.cwd || process.cwd()})
.then(resolve)
noRetry(args, opts).then(resolve)
.catch(err => {

@@ -32,1 +35,7 @@ if (operation.retry(err)) {

}
async function noRetry (args, opts) {
opts = opts || {}
gitLocation = gitLocation || await which('git')
return execa(gitLocation, args, {cwd: opts.cwd || process.cwd()})
}
{
"name": "graceful-git",
"version": "3.0.2",
"version": "3.1.0",
"description": "Executes git commands gracefully. Retries them on errors",

@@ -38,2 +38,3 @@ "main": "index.js",

"dependencies": {
"@zkochan/which": "^2.0.3",
"execa": "^5.0.0",

@@ -46,4 +47,4 @@ "retry": "^0.12.0"

"package-preview": "3.0.0",
"tape": "^5.0.1"
"tape": "^5.1.1"
}
}
# graceful-git
> Executes git commands gracefully. Retries on errors
> Executes Git commands gracefully. Retries on errors
Git is called by absolute path to avoid binary planting attacks on Windows.
<!--@shields('npm')-->

@@ -42,4 +44,8 @@ [![npm version](https://img.shields.io/npm/v/graceful-git.svg)](https://www.npmjs.com/package/graceful-git)

### `git.noRetry(args, [opts]) => Promise`
Same as `git()` but without retries.
## License
[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc