aboutsummaryrefslogtreecommitdiff
path: root/utils/inst
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-05-07 19:15:57 +0200
committerKarel Kočí <cynerd@email.cz>2017-05-07 19:15:57 +0200
commitb07415a90adc6fc40d4f693bdadaba49d6d8d7cb (patch)
tree4e9be209b92252a4705c369a8869007970e74583 /utils/inst
parent9fbf8d27ddbfb136351780615d42af82ddb42337 (diff)
downloadmyconfigs-b07415a90adc6fc40d4f693bdadaba49d6d8d7cb.tar.gz
myconfigs-b07415a90adc6fc40d4f693bdadaba49d6d8d7cb.tar.bz2
myconfigs-b07415a90adc6fc40d4f693bdadaba49d6d8d7cb.zip
Allow force install
That is installation without asking.
Diffstat (limited to 'utils/inst')
-rw-r--r--utils/inst17
1 files changed, 13 insertions, 4 deletions
diff --git a/utils/inst b/utils/inst
index 4d44cdf..2bb41f7 100644
--- a/utils/inst
+++ b/utils/inst
@@ -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 -e "\e[1;34m$1\e[0m"
+ # Fall trough with 0 exit (always yes)
+ else
+ echo -e -n "\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() {