]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/blobdiff - xdg-ninja.sh
Merge pull request #313 from iagoleal/fennel
[xdg-ninja.git] / xdg-ninja.sh
index 0e162e0edce66d05581507310e0c66720ee6ae04..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,12 @@ check_programs() {
     printf "\n"
 }
 
+[ "$XN_PROGRAMS_DIR" ] ||
+    XN_PROGRAMS_DIR="$(realpath "$0" | xargs dirname | sed 's:/bin$:/share/xdg-ninja:g')/programs"
 
 check_programs
-exit $FIXABLE
+if [ $FIXABLE -gt 100 ]; then
+    exit 101
+else
+    exit $FIXABLE
+fi