summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/deb.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/deb.sh b/src/deb.sh
index f2fb423..42f62d2 100755
--- a/src/deb.sh
+++ b/src/deb.sh
@@ -95,6 +95,20 @@ config_save()
done > "${DEB_DIR}/config"
}
+prompt_bool()
+{
+ _def="${1}"
+ _prompt="${2}"
+ shift 2
+ [ "${_def}" = y ] && _yn='[Y/n]' || _yn='[y/N]'
+ printf "${_prompt} ${_yn} " $@
+
+ read _val
+ [ "${_val}" = y ] && return 0
+ [ "${_val}" = n ] && return 1
+ [ "${_def}" = y ] && return 0 || return 1
+}
+
cmd_run()
{
"cmd_${COMMAND_NAME}" ${@}
@@ -114,6 +128,7 @@ cmd_init()
cd "${DEB_TREE}"
if [ -d .deb ]; then
+ prompt_bool n 'DEB work area exists. Reinitialize?' || exit
rm -Rf .deb dsc builds pkgs work
mkdir .deb dsc builds pkgs work
config_save