From dc5285b15caca7e2ea6113c54f8d028bb9efd735 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Mar 2021 19:20:02 -0400 Subject: [PATCH] Update 'hey update' to reflect upstream changes `nix flake update --update-input X` is now 'nix flake lock --update-input X' --- bin/hey | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/hey b/bin/hey index fc4a0c41..4d80aa42 100755 --- a/bin/hey +++ b/bin/hey @@ -153,12 +153,14 @@ module Hey desc "Update specific flakes or all of them" args "[INPUT...]" lambda do |args| - args.each do |flake| - puts "Trying to update #{flake}..." - sh ["nix", "flake", "update", "--update-input", flake, @@opts[:flake]] - end.empty? and begin + if args.empty? puts "Updating all flakes.." - sh ["nix", "flake", "update", "--recreate-lock-file", @@opts[:flake]] + sh ["nix", "flake", "update", @@opts[:flake]] + else + puts "Trying to update flakes: #{args.join ' '}" + sh ["nix", "flake", "lock"] + .concat(args.map { |f| [ "--update-input", f ]}.flatten) + .concat([@@opts[:flake]]) end end end