This commit is contained in:
DavHau 2021-10-07 14:38:19 +07:00
parent fb372a0f51
commit 1c48002dfc
2 changed files with 13 additions and 10 deletions

View File

@ -1,8 +1,9 @@
{
coreutils,
lib,
callPackageDream,
pkgs,
callPackageDream,
externalSources,
externals,
dream2nixWithExternals,
@ -48,7 +49,7 @@ let
bin = pkgs.writeScriptBin "translate" ''
#!${pkgs.bash}/bin/bash
jsonInputFile=$(realpath $1)
jsonInputFile=$(${coreutils}/bin/realpath $1)
outputFile=$(${pkgs.jq}/bin/jq '.outputFile' -c -r $jsonInputFile)
nix eval --show-trace --impure --raw --expr "

View File

@ -28,7 +28,7 @@
let
failureOffset = tryParse.value.offset;
in
throw "parser failed at: \n${lib.substring failureOffset (failureOffset + 50) tryParse.value.str}";
throw "parser failed at: \n${lib.substring failureOffset 50 tryParse.value.str}";
nameFromLockName = lockName:
let
version = lib.last (lib.splitString "@" lockName);
@ -69,13 +69,15 @@
dependencies = dependencyAttrs.dependencies or [] ++ dependencyAttrs.optionalDependencies or [];
graph = lib.forEach dependencies (dependency:
builtins.head (
lib.mapAttrsToList (name: value:
let
yarnName = "${name}@${value}";
version = parsedLock."${yarnName}".version;
in
"${name}#${version}"
) dependency
lib.mapAttrsToList
(name: value:
let
yarnName = "${name}@${value}";
version = parsedLock."${yarnName}".version;
in
"${name}#${version}"
)
dependency
)
);
in