about summary refs log tree commit diff stats
path: root/sys/nixpkgs/pkgs/scripts/source
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-03-29 23:21:25 +0100
committerSoispha <soispha@vhack.eu>2024-03-29 23:21:25 +0100
commitf69de9902d408a93456e890dc74d0e1ba8e88251 (patch)
tree659721879b9a4e5e861b10de19297158302b01bc /sys/nixpkgs/pkgs/scripts/source
parentfix(pkgs/scripts/fupdate): Avoid inversion in check for --no-script (diff)
downloadnixos-config-f69de9902d408a93456e890dc74d0e1ba8e88251.tar.gz
nixos-config-f69de9902d408a93456e890dc74d0e1ba8e88251.zip
fix(pkgs/scripts/fupdate): Avoid polluting the arguments of the update script
Previously, arguments to fupdate were also passed along to the update
script, they should now be filtered out. If passing them along is
wanted, they can be put behind a `--`.
Diffstat (limited to '')
-rwxr-xr-xsys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh b/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh
index 992a451a..c28f363f 100755
--- a/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh
+++ b/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh
@@ -163,6 +163,21 @@ done
 case "$1" in
 "flake")
     shift 1
+
+    # Filter out fupdate specific flags
+    while [ "$1" != "--" ]; do
+        # FIXME: This check allows to add a flag multiple times, but this should probably
+        # not be allowed <2024-03-29>
+        case "$1" in
+            "--no-script" | "-n")
+                shift 1;
+                ;;
+                *)
+                break;
+                ;;
+        esac
+    done
+
     [ "$1" = "--" ] && shift 1
     main "$@"
     ;;