bb/helpers/bbconfirm
Bruce Hill 865092c656 Major update: instead of defining all the helper functions as static
C-strings prefixed to commands (modified by the Makefile), the helper
functions are now standalone scripts in the helpers/ dir, which gets
added to "$PATH" when running bb.
2020-02-24 01:31:39 -08:00

10 lines
232 B
Bash
Executable File

#!/bin/sh
# Ask for user confirmation
set -e
if command -v ask >/dev/null; then
ask -n "$(printf "$1Is that okay?\033[?25h")"
else
reply="$(bbask -1 "$(printf "$1\033[0;1mIs that okay? [y/N] ")")"
[ "$reply" != 'y' ]
fi