mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-27 09:58:28 +01:00
addressed issue 48 (MKDIR_PROMPT ignored)
r819 mostly replaced directory_checks() and ck_dir() with dir_init() but forgot about the MKDIR_PROMPT variable used in ck_dir(). So again wrapped the prompting in a conditional based on that setting and moved the action outside the conditional.
This commit is contained in:
parent
dac7bd21c9
commit
f17e5ae404
1 changed files with 26 additions and 26 deletions
|
@ -283,43 +283,43 @@ dir_init() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ ${DI_OUTPUT[*]} ]]; then
|
if [[ ${DI_OUTPUT[*]} ]]; then
|
||||||
# Keep DI_OUTPUT_LINES and the 'table headers' aligned, too.
|
if [[ $MKDIR_PROMPT ]]; then
|
||||||
cat << EOF
|
# Keep DI_OUTPUT_LINES and the 'table headers' aligned, too.
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
The following directories do not exist:
|
The following directories do not exist:
|
||||||
|
|
||||||
Variable Assignment
|
Variable Assignment
|
||||||
-------- ----------
|
-------- ----------
|
||||||
EOF
|
EOF
|
||||||
for ((i=0; i<${#DI_OUTPUT[*]}; i++)); do
|
for ((i=0; i<${#DI_OUTPUT[*]}; i++)); do
|
||||||
echo "${DI_OUTPUT[$i]}"
|
echo "${DI_OUTPUT[$i]}"
|
||||||
done
|
done
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
You can have sbopkg create them or, if these values are incorrect, you can
|
You can have sbopkg create them or, if these values are incorrect, you can
|
||||||
abort to edit your config files or pass different flags.
|
abort to edit your config files or pass different flags.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
while :; do
|
while :; do
|
||||||
read $NFLAG -ep "(C)reate or (A)bort?: "
|
read $NFLAG -ep "(C)reate or (A)bort?: "
|
||||||
case $REPLY in
|
case $REPLY in
|
||||||
C|c)
|
C|c) break ;;
|
||||||
if ! mkdir -p $DIRS2MK 2>/dev/null; then
|
A|a)
|
||||||
echo "$SCRIPT: failed to create directories" >&2
|
if [[ ${FUNCNAME[1]} == main ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
else
|
||||||
break
|
return 1
|
||||||
;;
|
fi
|
||||||
A|a)
|
;;
|
||||||
if [[ ${FUNCNAME[1]} == main ]]; then
|
*) unknown_response ;;
|
||||||
exit 1
|
esac
|
||||||
else
|
done
|
||||||
return 1
|
fi
|
||||||
fi
|
if ! mkdir -p $DIRS2MK 2>/dev/null; then
|
||||||
;;
|
echo "$SCRIPT: failed to create directories" >&2
|
||||||
*) unknown_response ;;
|
exit 1
|
||||||
esac
|
fi
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for ((i=0; i<${#DIR_VARS[*]}; i++)); do
|
for ((i=0; i<${#DIR_VARS[*]}; i++)); do
|
||||||
|
|
Loading…
Reference in a new issue