mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
maintainers/scripts/update.nix: handle null paths
Previously we did not handle non-existant paths making the program crash. Let’s show a proper error.
This commit is contained in:
parent
36b2012447
commit
c3dd31f177
@ -69,9 +69,12 @@ let
|
||||
let
|
||||
attrSet = pkgs.lib.attrByPath (pkgs.lib.splitString "." path) null pkgs;
|
||||
in
|
||||
packagesWith (name: pkg: builtins.hasAttr "updateScript" pkg)
|
||||
(name: pkg: pkg)
|
||||
attrSet;
|
||||
if attrSet == null then
|
||||
builtins.throw "Attribute path `${path}` does not exists."
|
||||
else
|
||||
packagesWith (name: pkg: builtins.hasAttr "updateScript" pkg)
|
||||
(name: pkg: pkg)
|
||||
attrSet;
|
||||
|
||||
packageByName = name:
|
||||
let
|
||||
|
Loading…
Reference in New Issue
Block a user