Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-04-15 20:17:49 +0300
committerGar <gar+gh@danger.computer>2021-04-15 20:17:49 +0300
commit3b476a24cf0b2823fdf92505b84bddde4fcc8b14 (patch)
tree36f4cde2ea465bbb301f55200aa662f0d9abfc00 /node_modules/@npmcli
parentf9b639eb6c504ded6cdd59e83e26a392bfe81e5d (diff)
@npmcl/git@2.0.8
Diffstat (limited to 'node_modules/@npmcli')
-rw-r--r--node_modules/@npmcli/git/lib/clone.js8
-rw-r--r--node_modules/@npmcli/git/lib/opts.js1
-rw-r--r--node_modules/@npmcli/git/lib/utils.js13
-rw-r--r--node_modules/@npmcli/git/lib/which.js3
-rw-r--r--node_modules/@npmcli/git/package.json5
5 files changed, 9 insertions, 21 deletions
diff --git a/node_modules/@npmcli/git/lib/clone.js b/node_modules/@npmcli/git/lib/clone.js
index 0b88c79f3..1fea5acc8 100644
--- a/node_modules/@npmcli/git/lib/clone.js
+++ b/node_modules/@npmcli/git/lib/clone.js
@@ -24,7 +24,7 @@ const { basename, resolve } = require('path')
const revs = require('./revs.js')
const spawn = require('./spawn.js')
-const { isWindows, escapePath } = require('./utils.js')
+const { isWindows } = require('./utils.js')
const pickManifest = require('npm-pick-manifest')
const fs = require('fs')
@@ -112,7 +112,7 @@ const branch = (repo, revDoc, target, opts) => {
'-b',
revDoc.ref,
repo,
- escapePath(target, opts),
+ target,
'--recurse-submodules'
]
if (maybeShallow(repo, opts)) { args.push('--depth=1') }
@@ -125,7 +125,7 @@ const plain = (repo, revDoc, target, opts) => {
const args = [
'clone',
repo,
- escapePath(target, opts),
+ target,
'--recurse-submodules'
]
if (maybeShallow(repo, opts)) { args.push('--depth=1') }
@@ -151,7 +151,7 @@ const unresolved = (repo, ref, target, opts) => {
// can't do this one shallowly, because the ref isn't advertised
// but we can avoid checking out the working dir twice, at least
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 })
return mkdirp(target)
.then(() => git(cloneArgs.concat(lp)))
diff --git a/node_modules/@npmcli/git/lib/opts.js b/node_modules/@npmcli/git/lib/opts.js
index 6db9e9abe..144e0a3aa 100644
--- a/node_modules/@npmcli/git/lib/opts.js
+++ b/node_modules/@npmcli/git/lib/opts.js
@@ -7,5 +7,6 @@ const gitEnv = {
module.exports = (opts = {}) => ({
stdioString: true,
...opts,
+ shell: false,
env: opts.env || { ...gitEnv, ...process.env }
})
diff --git a/node_modules/@npmcli/git/lib/utils.js b/node_modules/@npmcli/git/lib/utils.js
index 82610a73a..fcd9578a1 100644
--- a/node_modules/@npmcli/git/lib/utils.js
+++ b/node_modules/@npmcli/git/lib/utils.js
@@ -1,16 +1,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
diff --git a/node_modules/@npmcli/git/lib/which.js b/node_modules/@npmcli/git/lib/which.js
index d4e113126..a2f690e1b 100644
--- a/node_modules/@npmcli/git/lib/which.js
+++ b/node_modules/@npmcli/git/lib/which.js
@@ -1,4 +1,3 @@
-const { escapePath } = require('./utils.js')
const which = require('which')
let gitPath
@@ -13,5 +12,5 @@ module.exports = (opts = {}) => {
if (!gitPath || opts.git === false) {
return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })
}
- return escapePath(gitPath, opts)
+ return gitPath
}
diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json
index c949936f8..9b368c31e 100644
--- a/node_modules/@npmcli/git/package.json
+++ b/node_modules/@npmcli/git/package.json
@@ -1,6 +1,6 @@
{
"name": "@npmcli/git",
- "version": "2.0.7",
+ "version": "2.0.8",
"main": "lib/index.js",
"files": [
"lib/*.js"
@@ -19,7 +19,8 @@
"prepublishOnly": "git push origin --follow-tags",
"preversion": "npm test",
"snap": "tap",
- "test": "tap"
+ "test": "tap",
+ "posttest": "npm run lint"
},
"tap": {
"check-coverage": true,