do nothing if git diff is empty

This commit is contained in:
Ranomier 2024-12-14 14:22:45 +01:00
parent 2ad67eb59a
commit d8c62fa4ee

View file

@ -12,7 +12,8 @@ printf ">>> auto formating ..."
nix fmt . &> /dev/null nix fmt . &> /dev/null
printf " DONE!\n" printf " DONE!\n"
git diff -U0 # "*.nix" [ -z "$(git diff -U0)" ] && echo ">>> no changes, exiting ..." && exit 0
git diff -U0 # "*.nix" # as a seperate command so we get nice colors and pager
printf ">>> Do you want to rebuild NixOS? [y/N]\n" printf ">>> Do you want to rebuild NixOS? [y/N]\n"
printf "<<< " && read -r YESNO printf "<<< " && read -r YESNO