mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-11 02:42:44 +03:00
fix github dependency for yarn v1
This commit is contained in:
parent
74bff7571b
commit
35f9cec8d0
@ -201,6 +201,7 @@ class PackageCommand(Command):
|
||||
)
|
||||
|
||||
# dump translator arguments to json file and execute translator
|
||||
print("Translating upstream metadata")
|
||||
with tempfile.NamedTemporaryFile("w") as input_json_file:
|
||||
json.dump(translator_input, input_json_file, indent=2)
|
||||
input_json_file.seek(0) # flushes write cache
|
||||
|
@ -42,20 +42,8 @@
|
||||
name = nameFromLockName dependencyName;
|
||||
in
|
||||
lib.nameValuePair ("${name}#${dependencyAttrs.version}") (
|
||||
if ! lib.hasInfix "@github:" dependencyName then
|
||||
{
|
||||
version = dependencyAttrs.version;
|
||||
hash = dependencyAttrs.integrity;
|
||||
url = lib.head (lib.splitString "#" dependencyAttrs.resolved);
|
||||
type = "fetchurl";
|
||||
}
|
||||
else if lib.hasInfix "@link:" dependencyName then
|
||||
{
|
||||
version = dependencyAttrs.version;
|
||||
path = lib.last (lib.splitString "@link:" dependencyName);
|
||||
type = "path";
|
||||
}
|
||||
else
|
||||
if lib.hasInfix "@github:" dependencyName
|
||||
|| lib.hasInfix "codeload.github.com/" dependencyAttrs.resolved then
|
||||
let
|
||||
gitUrlInfos = lib.splitString "/" dependencyAttrs.resolved;
|
||||
in
|
||||
@ -65,6 +53,23 @@
|
||||
owner = lib.elemAt gitUrlInfos 3;
|
||||
repo = lib.elemAt gitUrlInfos 4;
|
||||
}
|
||||
else if lib.hasInfix "@link:" dependencyName then
|
||||
{
|
||||
version = dependencyAttrs.version;
|
||||
path = lib.last (lib.splitString "@link:" dependencyName);
|
||||
type = "path";
|
||||
}
|
||||
else
|
||||
{
|
||||
version = dependencyAttrs.version;
|
||||
hash =
|
||||
if dependencyAttrs ? integrity then
|
||||
dependencyAttrs.integrity
|
||||
else
|
||||
throw "Missing integrity for ${dependencyName}";
|
||||
url = lib.head (lib.splitString "#" dependencyAttrs.resolved);
|
||||
type = "fetchurl";
|
||||
}
|
||||
)) parsedLock;
|
||||
dependencyGraph =
|
||||
(lib.mapAttrs'
|
||||
@ -105,7 +110,7 @@
|
||||
in
|
||||
"${depName}#${dependencyAttrs.version}"
|
||||
)
|
||||
packageJSON.dependencies;
|
||||
(packageJSON.dependencies or {} // packageJSON.devDependencies or {});
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user