aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpkgs/by-name/fu/fupdate-flake/fupdate-flake.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh b/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
index 6d343995..00c1e443 100755
--- a/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
+++ b/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
@@ -1,12 +1,24 @@
#! /usr/bin/env sh
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
UPDATE_SCRIPT_NAME="update.sh"
info() {
echo "Info: $1"
}
dbg() {
- [ -n "$DEBUG_ENABLE" ] && echo "Debug: $1"
+ if [ "${DEBUG_ENABLE-unset}" != "unset" ]; then
+ echo "Debug: $1" >&2
+ fi
}
die() {
echo "Error: $1"
@@ -37,7 +49,7 @@ upfind() {
while
search_result=$(fd "$search_string" "$current_directory/" --max-depth 1)
- dbg "Debugging upfind - search in $current_directory gives: $search_result"
+ dbg "upfind - search in $current_directory gives: $search_result"
[ -z "$search_result" ] && [ "$current_directory" != "/" ]
do current_directory=$(dirname "$current_directory"); done
@@ -58,7 +70,7 @@ upfind() {
get_storage_path() {
update_script="$(realpath "$1")"
- storage_path="$XDG_DATE_HOME/fupdate-flake/$update_script"
+ storage_path="$XDG_DATA_HOME/fupdate-flake/$update_script"
echo "$storage_path"
}
@@ -157,7 +169,7 @@ update() {
"$update_script" "$@"
if [ -f "flake.lock" ] && grep '[^0-9]_[0-9]' flake.lock --quiet; then
- batgrep '[^0-9]_[0-9]' flake.lock
+ grep '[^0-9]_[0-9]' flake.lock
die "Your flake.nix contains duplicate inputs!"
fi
}
@@ -177,4 +189,6 @@ main() {
fi
}
+main "$@"
+
# vim: ft=sh