mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-30 10:07:33 +03:00
fix bugs
This commit is contained in:
parent
fb372a0f51
commit
1c48002dfc
@ -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 "
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user