@npmcli/git
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -27,3 +27,3 @@ // The goal here is to minimize both git workload and | ||
const spawn = require('./spawn.js') | ||
const { isWindows, escapePath } = require('./utils.js') | ||
const { isWindows } = require('./utils.js') | ||
@@ -116,3 +116,3 @@ const pickManifest = require('npm-pick-manifest') | ||
repo, | ||
escapePath(target, opts), | ||
target, | ||
'--recurse-submodules' | ||
@@ -130,3 +130,3 @@ ] | ||
repo, | ||
escapePath(target, opts), | ||
target, | ||
'--recurse-submodules' | ||
@@ -157,3 +157,3 @@ ] | ||
const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : [] | ||
const cloneArgs = ['clone', '--mirror', '-q', repo, escapePath(target + '/.git', opts)] | ||
const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git'] | ||
const git = (args) => spawn(args, { ...opts, cwd: target }) | ||
@@ -160,0 +160,0 @@ return mkdirp(target) |
@@ -10,3 +10,4 @@ // Values we want to set if they're not already defined by the end user | ||
...opts, | ||
shell: false, | ||
env: opts.env || { ...gitEnv, ...process.env } | ||
}) |
@@ -1,16 +0,3 @@ | ||
const { basename } = require('path') | ||
const isWindows = opts => (opts.fakePlatform || process.platform) === 'win32' | ||
// wrap the target in quotes for Windows when using cmd(.exe) as a shell to | ||
// avoid clone failures for paths with spaces | ||
const escapePath = (gitPath, opts) => { | ||
const isCmd = opts.shell && (basename(opts.shell.toLowerCase(), '.exe') === 'cmd') | ||
if (isWindows(opts) && isCmd && !gitPath.startsWith('"')) { | ||
return `"${gitPath}"` | ||
} | ||
return gitPath | ||
} | ||
exports.escapePath = escapePath | ||
exports.isWindows = isWindows |
@@ -1,2 +0,1 @@ | ||
const { escapePath } = require('./utils.js') | ||
const which = require('which') | ||
@@ -16,3 +15,3 @@ | ||
} | ||
return escapePath(gitPath, opts) | ||
return gitPath | ||
} |
{ | ||
"name": "@npmcli/git", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"main": "lib/index.js", | ||
@@ -22,3 +22,4 @@ "files": [ | ||
"snap": "tap", | ||
"test": "tap" | ||
"test": "tap", | ||
"posttest": "npm run lint" | ||
}, | ||
@@ -25,0 +26,0 @@ "tap": { |
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
20446
421