Skip to content

Commit

Permalink
fix(flake): throw a human-readable message about removed extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Dec 9, 2024
1 parent eb09a09 commit bb5b33c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,23 @@
x:
builtins.foldl'
(
acc: y:
if !acc ? ${y.publisher} then
acc
extensions: removedPublisherConfig:
if !(extensions ? ${removedPublisherConfig.publisher}) then
extensions
else
acc // { "${y.publisher}" = builtins.removeAttrs acc.${y.publisher} y.extensions; }
extensions
// {
"${removedPublisherConfig.publisher}" = builtins.foldl' (
publisherExtensions: extensionName:
publisherExtensions
// {
"${extensionName}" = builtins.throw ''
The extension '${removedPublisherConfig.publisher}.${extensionName}' was removed.
See '${./removed.nix}' for details.
'';
}
) extensions.${removedPublisherConfig.publisher} removedPublisherConfig.extensions;
}
)
x
(
Expand Down

0 comments on commit bb5b33c

Please sign in to comment.