summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/pkg b/bin/pkg
index 494e922..5197074 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -28,13 +28,17 @@ die () {
}
confirm_yes () {
- echo -n "${info}$*${reset} [Y/n] "
- read -q
- [ -z "$REPLY" ] && true
+ echo -n "$* [Y/n] "
+ read -k 1
+ if ([ "$REPLY" = 'y' -o "$REPLY" = 'Y' -o "$REPLY" = $'\n' ]) {
+ true
+ } else {
+ false
+ }
}
confirm_no () {
- echo -n "${error}$*${reset} [y/N] "
+ echo -n "$* [y/N] "
read -q
}