Move PROMPT check into question_prompt script
Add check if PROMPT="FORCED"
MODIFY
.scripts/appvars_purge.sh
.scripts/appvars_purge.sh
@@ -17,9 +17,6 @@ appvars_purge() {
fi
local PREPROMPT=${PROMPT:-}
- if [[ ${CI:-} != true ]] && [[ ${PROMPT:-} != "GUI" ]]; then
- PROMPT="CLI"
- fi
if [[ ${CI:-} == true ]] || run_script 'question_prompt' "${PROMPT:-}" N "Would you like to purge these settings for ${APPNAME}?\\n\\n${APPVARS}"; then
info "Purging ${APPNAME} .env variables."
sed -i "/^${APPNAME}_/d" "${SCRIPTPATH}/compose/.env" || fatal "Failed to purge ${APPNAME} variables."

MODIFY
.scripts/appvars_purge_all.sh
.scripts/appvars_purge_all.sh
@@ -5,9 +5,6 @@ IFS=$'\n\t'
appvars_purge_all() {
if grep -q '_ENABLED=false$' "${SCRIPTPATH}/compose/.env"; then
local PREPROMPT=${PROMPT:-}
- if [[ ${CI:-} != true ]] && [[ ${PROMPT:-} != "GUI" ]]; then
- PROMPT="CLI"
- fi
if [[ ${CI:-} == true ]] || run_script 'question_prompt' "${PROMPT:-}" N "Would you like to purge variables for all disabled apps?"; then
info "Purging disabled app variables."
while IFS= read -r line; do

MODIFY
.scripts/question_prompt.sh
.scripts/question_prompt.sh
@@ -7,6 +7,9 @@ question_prompt() {
local DEFAULT=${2:-Y}
local QUESTION=${3:-}
local YN
+ if [[ ${PROMPT:-} != "FORCED" ]] && [[ ${PROMPT:-} != "GUI" ]]; then
+ PROMPT="CLI"
+ fi
while true; do
if [[ ${CI:-} == true ]]; then
YN=${DEFAULT}

Move PROMPT check into question_prompt script
Add check if PROMPT="FORCED"