dotfiles

My personal dotfiles 💠️

commit 2f323f823cdc1b4d7373fe1848b467969707a452
parent da7e14c1fcfe6d57d2490254242ed3ab4928c7b8
Author: Pablo <pablo-escobar@riseup.net>
Date:   Mon,  2 Aug 2021 21:30:11 -0300

Updated the config script

Diffstat:
M.local/bin/config | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/.local/bin/config b/.local/bin/config
@@ -121,15 +121,21 @@ case "$1" in
     config_git_status="$(mktemp)"
     call_git status > "$config_git_status"
 
-    echo 'modified files:'
-    awk '/modified/ { print $2 }' "$config_git_status" \
-      | xargs -r realpath \
-      | xargs -r -n 1 printf '    %s\n'
-
-    echo 'deleted files:'
-    awk '/deleted/ { print $2 }' "$config_git_status" \
-      | xargs -r realpath \
-      | xargs -r -n 1 printf '    %s\n'
+    if grep modified "$config_git_status" > /dev/null;
+    then
+      printf '\033[0;33mmodified files:\n'
+      awk '/modified/ { print $2 }' "$config_git_status" \
+        | xargs -r realpath \
+        | xargs -r -n 1 printf '    %s\033[0m\n'
+    fi
+
+    if grep deleted "$config_git_status" > /dev/null;
+    then
+      printf '\033[0;31mdeleted files:\n'
+      awk '/deleted/ { print $2 }' "$config_git_status" \
+        | xargs -r realpath \
+        | xargs -r -n 1 printf '    %s\033[0m\n'
+    fi
 
     rm "$config_git_status"
     ;;