@npmcli/git
Advanced tools
Comparing version 4.0.3 to 4.0.4
@@ -30,4 +30,3 @@ // The goal here is to minimize both git workload and | ||
const pickManifest = require('npm-pick-manifest') | ||
const fs = require('fs') | ||
const mkdirp = require('mkdirp') | ||
const fs = require('fs/promises') | ||
@@ -97,3 +96,3 @@ module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => | ||
const git = (args) => spawn(args, { ...opts, cwd: target }) | ||
return mkdirp(target) | ||
return fs.mkdir(target, { recursive: true }) | ||
.then(() => git(['init'])) | ||
@@ -146,15 +145,17 @@ .then(() => isWindows(opts) | ||
const updateSubmodules = (target, opts) => new Promise(resolve => | ||
fs.stat(target + '/.gitmodules', er => { | ||
if (er) { | ||
return resolve(null) | ||
} | ||
return resolve(spawn([ | ||
'submodule', | ||
'update', | ||
'-q', | ||
'--init', | ||
'--recursive', | ||
], { ...opts, cwd: target })) | ||
})) | ||
const updateSubmodules = async (target, opts) => { | ||
const hasSubmodules = await fs.stat(`${target}/.gitmodules`) | ||
.then(() => true) | ||
.catch(() => false) | ||
if (!hasSubmodules) { | ||
return null | ||
} | ||
return spawn([ | ||
'submodule', | ||
'update', | ||
'-q', | ||
'--init', | ||
'--recursive', | ||
], { ...opts, cwd: target }) | ||
} | ||
@@ -167,3 +168,3 @@ const unresolved = (repo, ref, target, opts) => { | ||
const git = (args) => spawn(args, { ...opts, cwd: target }) | ||
return mkdirp(target) | ||
return fs.mkdir(target, { recursive: true }) | ||
.then(() => git(cloneArgs.concat(lp))) | ||
@@ -170,0 +171,0 @@ .then(() => git(['init'])) |
{ | ||
"name": "@npmcli/git", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"main": "lib/index.js", | ||
@@ -35,5 +35,4 @@ "files": [ | ||
"@npmcli/eslint-config": "^4.0.0", | ||
"@npmcli/template-oss": "4.8.0", | ||
"@npmcli/template-oss": "4.12.0", | ||
"npm-package-arg": "^10.0.0", | ||
"rimraf": "^3.0.2", | ||
"slash": "^3.0.0", | ||
@@ -45,3 +44,2 @@ "tap": "^16.0.1" | ||
"lru-cache": "^7.4.4", | ||
"mkdirp": "^1.0.4", | ||
"npm-pick-manifest": "^8.0.0", | ||
@@ -60,4 +58,4 @@ "proc-log": "^3.0.0", | ||
"windowsCI": false, | ||
"version": "4.8.0" | ||
"version": "4.12.0" | ||
} | ||
} |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
8
5
470
21786
- Removedmkdirp@^1.0.4
- Removedmkdirp@1.0.4(transitive)