diff options
author | Karel Kočí <cynerd@email.cz> | 2017-05-07 19:02:22 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-05-07 19:04:43 +0200 |
commit | 9cbf75f5992eb57343fb9cb3eec9e6fa2a9df08d (patch) | |
tree | 87fd19c9805b2064e264481284d215f40f312ae1 /utils | |
parent | b1258d579cb9656b851840dd466150357a2ea265 (diff) | |
download | myconfigs-9cbf75f5992eb57343fb9cb3eec9e6fa2a9df08d.tar.gz myconfigs-9cbf75f5992eb57343fb9cb3eec9e6fa2a9df08d.tar.bz2 myconfigs-9cbf75f5992eb57343fb9cb3eec9e6fa2a9df08d.zip |
Revert simplifications but add force option
Diffstat (limited to 'utils')
-rw-r--r-- | utils/inst | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -2,9 +2,14 @@ # vim: ft=sh ask() { - echo -ne "\e[1;34m$1 (Y/n) \e[0m" - read - [[ $REPLY =~ ^[Yy]?$ ]] + if $FORCE; then + echo -ne "\e[1;34m$1\e[0m" + # Fall trough with 0 exit (always yes) + else + echo -ne "\e[1;34m$1? (Y/n) \e[0m" + read + [[ $REPLY =~ ^[Yy]?$ ]] + fi } dodiff() { @@ -25,7 +30,11 @@ dodiff() { echo -e "\e[1;32mNo difference detected:\e[0m $OUT" return fi - vimdiff "$1" "$OUT" + if $FORCE; then + doinst "$1" "$OUT" + else + vimdiff "$1" "$OUT" + fi } checkdiff() { |