diff options
author | AmineChikhaoui <amine@chikhaoui.org> | 2021-04-15 05:02:41 -0400 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2021-12-04 08:02:10 +0100 |
commit | 487aaa905f78e7f3acaef238650552d74730851b (patch) | |
tree | 1a5ec9061a012b17d34357b5778816a4b0696d28 /pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal | |
parent | dad4fddd52923d90c5ad981d5e29963e829de3c1 (diff) | |
download | nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar.gz nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar.bz2 nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar.lz nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar.xz nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.tar.zst nixpkgs-487aaa905f78e7f3acaef238650552d74730851b.zip |
yarn2nix: use yarn lockfile integrity field whenever possible
Whenever available use the SRI hashes from the integrity field to create the fetchurl calls instead of entirely relying on the `resolved` sha1 which may or may not exist with recent yarn versions. Related issues: - https://github.com/nix-community/yarn2nix/issues/125 - https://github.com/NixOS/nixpkgs/issues/77238
Diffstat (limited to 'pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal')
-rwxr-xr-x | pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js index 86e92f85208..3c067fc99aa 100755 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js @@ -25,14 +25,14 @@ const result = [] readFile .on('line', line => { - const arr = line.match(/^ {2}resolved "([^#]+)#([^"]+)"$/) + const arr = line.match(/^ {2}resolved "([^#]+)(#[^"]+)?"$/) if (arr !== null) { const [_, url, shaOrRev] = arr const fileName = urlToName(url) - result.push(` resolved "${fileName}#${shaOrRev}"`) + result.push(` resolved "${fileName}${shaOrRev ?? ''}"`) } else { result.push(line) } |