do nothing if git diff is empty
This commit is contained in:
parent
2ad67eb59a
commit
d8c62fa4ee
1 changed files with 2 additions and 1 deletions
3
nswitch
3
nswitch
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue