]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/commitdiff
Exit status = amount of fixable files
authorb3nj4m1n <b3nj4m1n@gmx.net>
Sat, 5 Nov 2022 03:36:38 +0000 (04:36 +0100)
committerb3nj4m1n <b3nj4m1n@gmx.net>
Sat, 5 Nov 2022 03:36:38 +0000 (04:36 +0100)
Closes #94

xdg-ninja.sh

index ed0e8ddda2766f13de74dc9e4fe1dc00618d5db0..833220783382e40650d2d42c008577f2abd28a85 100755 (executable)
@@ -136,6 +136,9 @@ decode_string() {
 /' # Replace \n with literal newline and \" with ", normalize number of trailing newlines to 2
 }
 
+# Counter to keep track of how many files can be moved
+FIXABLE=0
+
 # Function to handle the formatting of output
 log() {
     MODE="$1"
@@ -147,6 +150,7 @@ log() {
 
     ERR)
         printf '[%b%s%b]: %b%s%b\n' "${FX_BOLD}${FG_RED}" "$NAME" "${FX_RESET}" "${FX_BOLD}${FX_ITALIC}" "$FILENAME" "${FX_RESET}"
+        FIXABLE=$((FIXABLE+1))
         ;;
 
     WARN)
@@ -223,3 +227,4 @@ check_programs() {
 
 
 check_programs
+exit $FIXABLE