.dotfiles/helpers/prompt.sh

12 lines
212 B
Bash
Raw Normal View History

2020-11-08 21:55:05 +01:00
#!/bin/bash
prompt() {
read -p "$1 (y/n)? " choice
case "$choice" in
y | Y) echo "yes" ;;
n | N) echo "no" ;;
*) echo "invalid" ;;
esac
}
[[ "${1}" != "--source-only" ]] && prompt "${@}"