mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
fetch-yarn-deps: handle yarn.lock deps without a resolved url
This commit is contained in:
parent
d544d8d66c
commit
2400268a38
@ -12,6 +12,15 @@ const fixupYarnLock = async (lockContents, verbose) => {
|
||||
const fixedData = Object.fromEntries(
|
||||
Object.entries(lockData.object)
|
||||
.map(([dep, pkg]) => {
|
||||
if (pkg.resolved === undefined) {
|
||||
console.warn(`no resolved URL for package ${dep}`)
|
||||
var maybeFile = dep.split("@", 2)[1]
|
||||
if (maybeFile.startsWith("file:")) {
|
||||
console.log(`Rewriting URL for local file dependency ${dep}`)
|
||||
pkg.resolved = maybeFile
|
||||
}
|
||||
return [dep, pkg]
|
||||
}
|
||||
const [ url, hash ] = pkg.resolved.split("#", 2)
|
||||
|
||||
if (hash || url.startsWith("https://codeload.github.com")) {
|
||||
|
Loading…
Reference in New Issue
Block a user