Skip to content

Commit 9a7b8e8

Browse files
committed
deps: @npmcli/git@4.0.4
1 parent 57c0a55 commit 9a7b8e8

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

DEPENDENCIES.md

-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ graph LR;
653653
npmcli-docs-->yaml;
654654
npmcli-fs-->semver;
655655
npmcli-git-->lru-cache;
656-
npmcli-git-->mkdirp;
657656
npmcli-git-->npm-pick-manifest;
658657
npmcli-git-->npmcli-promise-spawn["@npmcli/promise-spawn"];
659658
npmcli-git-->proc-log;

node_modules/@npmcli/git/lib/clone.js

+18-17
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ const spawn = require('./spawn.js')
2727
const { isWindows } = require('./utils.js')
2828

2929
const pickManifest = require('npm-pick-manifest')
30-
const fs = require('fs')
31-
const mkdirp = require('mkdirp')
30+
const fs = require('fs/promises')
3231

3332
module.exports = (repo, ref = 'HEAD', target = null, opts = {}) =>
3433
getRevs(repo, opts).then(revs => clone(
@@ -93,7 +92,7 @@ const other = (repo, revDoc, target, opts) => {
9392
.concat(shallow ? ['--depth=1'] : [])
9493

9594
const git = (args) => spawn(args, { ...opts, cwd: target })
96-
return mkdirp(target)
95+
return fs.mkdir(target, { recursive: true })
9796
.then(() => git(['init']))
9897
.then(() => isWindows(opts)
9998
? git(['config', '--local', '--add', 'core.longpaths', 'true'])
@@ -141,27 +140,29 @@ const plain = (repo, revDoc, target, opts) => {
141140
return spawn(args, opts).then(() => revDoc.sha)
142141
}
143142

144-
const updateSubmodules = (target, opts) => new Promise(resolve =>
145-
fs.stat(target + '/.gitmodules', er => {
146-
if (er) {
147-
return resolve(null)
148-
}
149-
return resolve(spawn([
150-
'submodule',
151-
'update',
152-
'-q',
153-
'--init',
154-
'--recursive',
155-
], { ...opts, cwd: target }))
156-
}))
143+
const updateSubmodules = async (target, opts) => {
144+
const hasSubmodules = await fs.stat(`${target}/.gitmodules`)
145+
.then(() => true)
146+
.catch(() => false)
147+
if (!hasSubmodules) {
148+
return null
149+
}
150+
return spawn([
151+
'submodule',
152+
'update',
153+
'-q',
154+
'--init',
155+
'--recursive',
156+
], { ...opts, cwd: target })
157+
}
157158

158159
const unresolved = (repo, ref, target, opts) => {
159160
// can't do this one shallowly, because the ref isn't advertised
160161
// but we can avoid checking out the working dir twice, at least
161162
const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : []
162163
const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git']
163164
const git = (args) => spawn(args, { ...opts, cwd: target })
164-
return mkdirp(target)
165+
return fs.mkdir(target, { recursive: true })
165166
.then(() => git(cloneArgs.concat(lp)))
166167
.then(() => git(['init']))
167168
.then(() => git(['checkout', ref]))

node_modules/@npmcli/git/package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/git",
3-
"version": "4.0.3",
3+
"version": "4.0.4",
44
"main": "lib/index.js",
55
"files": [
66
"bin/",
@@ -32,16 +32,14 @@
3232
},
3333
"devDependencies": {
3434
"@npmcli/eslint-config": "^4.0.0",
35-
"@npmcli/template-oss": "4.8.0",
35+
"@npmcli/template-oss": "4.12.0",
3636
"npm-package-arg": "^10.0.0",
37-
"rimraf": "^3.0.2",
3837
"slash": "^3.0.0",
3938
"tap": "^16.0.1"
4039
},
4140
"dependencies": {
4241
"@npmcli/promise-spawn": "^6.0.0",
4342
"lru-cache": "^7.4.4",
44-
"mkdirp": "^1.0.4",
4543
"npm-pick-manifest": "^8.0.0",
4644
"proc-log": "^3.0.0",
4745
"promise-inflight": "^1.0.1",
@@ -55,6 +53,6 @@
5553
"templateOSS": {
5654
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
5755
"windowsCI": false,
58-
"version": "4.8.0"
56+
"version": "4.12.0"
5957
}
6058
}

package-lock.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"@npmcli/docs": "^1.0.0",
159159
"@npmcli/eslint-config": "^4.0.0",
160160
"@npmcli/fs": "^3.1.0",
161-
"@npmcli/git": "^4.0.1",
161+
"@npmcli/git": "^4.0.4",
162162
"@npmcli/mock-registry": "^1.0.0",
163163
"@npmcli/promise-spawn": "^6.0.2",
164164
"@npmcli/template-oss": "4.12.0",
@@ -2100,14 +2100,13 @@
21002100
}
21012101
},
21022102
"node_modules/@npmcli/git": {
2103-
"version": "4.0.3",
2104-
"resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.3.tgz",
2105-
"integrity": "sha512-8cXNkDIbnXPVbhXMmQ7/bklCAjtmPaXfI9aEM4iH+xSuEHINLMHhlfESvVwdqmHJRJkR48vNJTSUvoF6GRPSFA==",
2103+
"version": "4.0.4",
2104+
"resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.4.tgz",
2105+
"integrity": "sha512-5yZghx+u5M47LghaybLCkdSyFzV/w4OuH12d96HO389Ik9CDsLaDZJVynSGGVJOLn6gy/k7Dz5XYcplM3uxXRg==",
21062106
"inBundle": true,
21072107
"dependencies": {
21082108
"@npmcli/promise-spawn": "^6.0.0",
21092109
"lru-cache": "^7.4.4",
2110-
"mkdirp": "^1.0.4",
21112110
"npm-pick-manifest": "^8.0.0",
21122111
"proc-log": "^3.0.0",
21132112
"promise-inflight": "^1.0.1",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
"@npmcli/docs": "^1.0.0",
192192
"@npmcli/eslint-config": "^4.0.0",
193193
"@npmcli/fs": "^3.1.0",
194-
"@npmcli/git": "^4.0.1",
194+
"@npmcli/git": "^4.0.4",
195195
"@npmcli/mock-registry": "^1.0.0",
196196
"@npmcli/promise-spawn": "^6.0.2",
197197
"@npmcli/template-oss": "4.12.0",

0 commit comments

Comments
 (0)