about summary refs log tree commit diff stats
path: root/pkgs/by-name/fu/fupdate-flake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpkgs/by-name/fu/fupdate-flake/fupdate-flake.sh10
-rw-r--r--pkgs/by-name/fu/fupdate-flake/package.nix9
2 files changed, 13 insertions, 6 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..f63d7de0 100755
--- a/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
+++ b/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh
@@ -6,7 +6,9 @@ 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 +39,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 +60,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"
 }
 
@@ -177,4 +179,6 @@ main() {
     fi
 }
 
+main
+
 # vim: ft=sh
diff --git a/pkgs/by-name/fu/fupdate-flake/package.nix b/pkgs/by-name/fu/fupdate-flake/package.nix
index d2784169..5b2d7d29 100644
--- a/pkgs/by-name/fu/fupdate-flake/package.nix
+++ b/pkgs/by-name/fu/fupdate-flake/package.nix
@@ -7,19 +7,22 @@
   bat-extras, # For `batgrep`
   bat, # used by batgrep
   gnused, # required by batgrep
+  git,
 }:
 writeShellApplication {
   name = "fupdate-flake";
-  tetx = builtins.readFile ./fupdate-flake.sh;
+  text = builtins.readFile ./fupdate-flake.sh;
 
-  inheritPath = false;
+  # The `update.sh` script might actually want to keep the path.
+  inheritPath = true;
 
   runtimeInputs = [
     coreutils
     fd
     gnugrep
-    bat-extras # For `batgrep`
+    bat-extras.batgrep
     bat # Used by `batgrep`
     gnused # Required by `batgrep`
+    git
   ];
 }