mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-20 02:48:04 +03:00
Merge pull request #99 from tgunnoe/git-plus-resolved
fix: parse resolved keys with git+https correctly
This commit is contained in:
commit
83c1d872d7
@ -100,7 +100,8 @@
|
||||
|| (dObj
|
||||
? resolved
|
||||
&& lib.hasInfix "codeload.github.com/" dObj.resolved)
|
||||
|| lib.hasInfix "@git+" dObj.yarnName
|
||||
|| (lib.hasInfix "@git+" dObj.yarnName
|
||||
|| lib.hasPrefix "git+" dObj.resolved)
|
||||
# example:
|
||||
# "jest-image-snapshot@https://github.com/machard/jest-image-snapshot#machard-patch-1":
|
||||
# version "4.2.0"
|
||||
@ -141,7 +142,9 @@
|
||||
|
||||
extractors = {
|
||||
name = rawObj: finalObj:
|
||||
if lib.hasInfix "@git+" rawObj.yarnName
|
||||
if
|
||||
(lib.hasInfix "@git+" rawObj.yarnName
|
||||
|| lib.hasPrefix "git+" rawObj.resolved)
|
||||
then lib.head (lib.splitString "@git+" rawObj.yarnName)
|
||||
# Example:
|
||||
# @matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz
|
||||
@ -161,7 +164,7 @@
|
||||
split = l.splitString "@git+" rawObj.yarnName;
|
||||
gitUrl = l.last split;
|
||||
in
|
||||
# l.strings.sanitizeDerivationName
|
||||
l.strings.sanitizeDerivationName
|
||||
"${rawObj.version}@git+${gitUrl}"
|
||||
else rawObj.version;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user