mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-21 03:19:17 +03:00
fix parsing CRLF formatted files
This commit is contained in:
parent
1c48002dfc
commit
d06519bce0
@ -69,6 +69,7 @@
|
||||
|
||||
shellHook = ''
|
||||
export NIX_PATH=nixpkgs=${nixpkgs}
|
||||
export d2nExternalSources=${externalSourcesFor."${system}"}
|
||||
'';
|
||||
});
|
||||
};
|
||||
|
@ -16,7 +16,7 @@
|
||||
}:
|
||||
let
|
||||
b = builtins;
|
||||
yarnLock = "${lib.elemAt inputDirectories 0}/yarn.lock";
|
||||
yarnLock = utils.readTextFile "${lib.elemAt inputDirectories 0}/yarn.lock";
|
||||
packageJSON = b.fromJSON (b.readFile "${lib.elemAt inputDirectories 0}/package.json");
|
||||
parser = import ./parser.nix { inherit lib; inherit (externals) nix-parsec;};
|
||||
tryParse = parser.parseLock yarnLock;
|
||||
|
@ -73,5 +73,5 @@ rec {
|
||||
(skipThen skipEmptyLinesAndComments
|
||||
(thenSkip (sepBy group newLine) eof));
|
||||
|
||||
parseLock = path: nix-parsec.parsec.runParser configFile (builtins.readFile path);
|
||||
parseLock = text: nix-parsec.parsec.runParser configFile text;
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ rec {
|
||||
|
||||
readDreamLock = callPackageDream ./readDreamLock.nix {};
|
||||
|
||||
readTextFile = file: lib.replaceStrings [ "\r\n" ] [ "\n" ] (b.readFile file);
|
||||
|
||||
isFile = path: (builtins.readDir (b.dirOf path))."${b.baseNameOf path}" == "regular";
|
||||
|
||||
isDir = path: (builtins.readDir (b.dirOf path))."${b.baseNameOf path}" == "directory";
|
||||
|
Loading…
Reference in New Issue
Block a user