From 4b08138747e9ec128223bdcd643e6f33f45b76e3 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 23 Mar 2024 20:47:07 +0100 Subject: feat(pkgs/scripts/fupdate): Add support for updating without running the script --- sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'sys/nixpkgs/pkgs') diff --git a/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh b/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh index e398f0fd..ba2dc88b 100755 --- a/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh +++ b/sys/nixpkgs/pkgs/scripts/source/apps/fupdate.sh @@ -12,6 +12,8 @@ AUTHORS="Soispha" # shellcheck disable=SC2034 YEARS="2023" +UPDATE_SCRIPT_NOT_WANTED=false + # Searches upward for a `UPDATE_SCRIPT_NAME` script # Returns a path to the script if it exists, otherwise nothing is returned check_for_update_script() { @@ -80,7 +82,9 @@ update() { nix flake update - [ "$update_script" = "" ] || "$update_script" "$@" + if ! [ "$update_script" = "" ] && [ "$UPDATE_SCRIPT_NOT_WANTED" = "true" ]; then + "$update_script" "$@" + fi if grep '[^0-9]_[0-9]' flake.lock >/dev/null; then batgrep '[^0-9]_[0-9]' flake.lock @@ -92,18 +96,22 @@ help() { cat < runs a executable called "update-", if it exists EOF @@ -142,6 +150,9 @@ for input in "$@"; do version exit 0 ;; + "--no-script" | "-n") + UPDATE_SCRIPT_NOT_WANTED=true + ;; "--") end_of_cli_options=true ;; -- cgit 1.4.1