|
|
@ -59,14 +59,14 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
fzf_base="$(pwd)"
|
|
|
|
fzf_base="$(pwd)"
|
|
|
|
|
|
|
|
|
|
|
|
ask() {
|
|
|
|
ask() {
|
|
|
|
# If stdin is a tty, we are "interactive".
|
|
|
|
while true; do
|
|
|
|
# non-interactive shell: wait for a linefeed
|
|
|
|
read -p "$1 ([y]/n) " -r
|
|
|
|
# interactive shell: continue after a single keypress
|
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
|
|
read_n=$([ -t 0 ] && echo "-n 1")
|
|
|
|
return 1
|
|
|
|
|
|
|
|
elif [[ $REPLY =~ ^[Nn]$ ]]; then
|
|
|
|
read -p "$1 ([y]/n) " $read_n -r
|
|
|
|
return 0
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
[[ $REPLY =~ ^[Nn]$ ]]
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
check_binary() {
|
|
|
|
check_binary() {
|
|
|
|