PHP 8.2.30
Preview: git.js Size: 1.21 KB
/proc/self/root/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/git.js

// handle some git configuration for windows

exports.spawn = spawnGit
exports.chainableExec = chainableExec
exports.whichAndExec = whichAndExec

var exec = require('child_process').execFile
var spawn = require('./spawn')
var npm = require('../npm.js')
var which = require('which')
var git = npm.config.get('git')
var assert = require('assert')
var log = require('npmlog')
var noProgressTillDone = require('./no-progress-while-running.js').tillDone

function prefixGitArgs () {
  return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : []
}

function execGit (args, options, cb) {
  log.info('git', args)
  var fullArgs = prefixGitArgs().concat(args || [])
  return exec(git, fullArgs, options, noProgressTillDone(cb))
}

function spawnGit (args, options) {
  log.info('git', args)
  return spawn(git, prefixGitArgs().concat(args || []), options)
}

function chainableExec () {
  var args = Array.prototype.slice.call(arguments)
  return [execGit].concat(args)
}

function whichAndExec (args, options, cb) {
  assert.equal(typeof cb, 'function', 'no callback provided')
  // check for git
  which(git, function (err) {
    if (err) {
      err.code = 'ENOGIT'
      return cb(err)
    }

    execGit(args, options, cb)
  })
}

Directory Contents

Dirs: 1 × Files: 34

Name Size Perms Modified Actions
- drwxr-xr-x 2024-03-03 22:41:42
Edit Download
290 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
1.62 KB lrwxr-xr-x 2021-09-28 09:36:04
Edit Download
3.04 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
424 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
390 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
4.99 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
9.69 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
673 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
777 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
8.65 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
807 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
1.21 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
129 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
153 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
59 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
11.37 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
2.02 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
1.81 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
2.66 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
949 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
541 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
210 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
399 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
592 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
426 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
329 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
319 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
349 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
1.38 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
14.46 KB lrw-r--r-- 2021-09-28 09:36:04
Edit Download
173 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
343 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
576 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download
556 B lrw-r--r-- 2021-09-28 09:36:04
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).