Skip to content

Commit

Permalink
deps: @npmcli/git@4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Jun 6, 2023
1 parent 075b90d commit 1ea9b52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions lib/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@ const path = require('path')
const log = require('proc-log')
const git = require('@npmcli/git')

// Replace with https://github.com/npm/git/pull/135 once it lands
const gitFind = async ({ cwd, root }) => {
if (await git.is({ cwd })) {
return cwd
}
while (cwd !== path.dirname(cwd) && cwd !== root) {
cwd = path.dirname(cwd)
if (await git.is({ cwd })) {
return cwd
}
}
return null
}

const normalize = async (pkg, { strict, steps, root }) => {
const data = pkg.content
const scripts = data.scripts || {}
Expand Down Expand Up @@ -193,7 +179,7 @@ const normalize = async (pkg, { strict, steps, root }) => {

// populate "gitHead" attribute
if (steps.includes('gitHead') && !data.gitHead) {
const gitRoot = await gitFind({ cwd: pkg.path, root })
const gitRoot = await git.find({ cwd: pkg.path, root })
let head
if (gitRoot) {
try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"tap": "^16.0.1"
},
"dependencies": {
"@npmcli/git": "^4.0.4",
"@npmcli/git": "^4.1.0",
"glob": "^10.2.2",
"json-parse-even-better-errors": "^3.0.0",
"normalize-package-data": "^5.0.0",
Expand Down

0 comments on commit 1ea9b52

Please sign in to comment.