]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/blobdiff - xdg-ninja.sh
Merge pull request #267 from Hitesh-Aggarwal/main
[xdg-ninja.git] / xdg-ninja.sh
index 8a0ff98ca6c48af2a5c02d4de6cb34cc0fbfe9b1..8780de7a2e26f4880ac30e4d15749b7e3a2f4c43 100755 (executable)
@@ -218,7 +218,7 @@ do_check_programs() {
 " read -r name; read -r filename; read -r movable; read -r help; do
         check_file "$name" "$filename" "$movable" "$help"
     done <<EOF
-$(jq 'inputs as $input | $input.files[] as $file | $input.name, $file.path, $file.movable, $file.help' "$(realpath "$0" | xargs dirname)"/programs/* | sed -e 's/^"//' -e 's/"$//')
+$(jq 'inputs as $input | $input.files[] as $file | $input.name, $file.path, $file.movable, $file.help' "$XN_PROGRAMS_DIR"/* | sed -e 's/^"//' -e 's/"$//')
 EOF
 # sed is to trim quotes
 }
@@ -233,6 +233,9 @@ check_programs() {
     printf "\n"
 }
 
+[ "$XN_PROGRAMS_DIR" ] ||
+    XN_PROGRAMS_DIR="$(realpath "$0" | xargs dirname | sed 's:/bin$:/share/xdg-ninja:g')/programs"
+
 check_programs
 if [ $FIXABLE -gt 100 ]; then
     exit 101