Skip to content

Commit 941aff2

Browse files
authored
Update upgrade.sh: Add code to prompt for upgrade type
1 parent 99f385c commit 941aff2

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

upgrade.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,26 @@ OLDEST_DIR="${PRIOR_ALLSKY_DIR}-OLDEST"
228228
if [[ ${ACTION} == "upgrade" ]]; then
229229
# First part of upgrade, executed by user in ${ALLSKY_HOME}.
230230

231-
IN_PLACE="true" # TODO: XXXXXXXXXXXXXXXX prompt for it
232231

233232
# Ask user if they want to move ${ALLSKY_HOME} to ${ALLSKY_PRIOR_DIR},
234233
# or upgrade in place (i.e., overwrite code).
234+
if false; then
235+
RESPONSE="$( dialog --clear \
236+
--colors \
237+
--title "Pick Upgrade Method" \
238+
--menu "\nChoose a Respository:" 15 40 2 \
239+
1 "In Place - Overwrites existing Allsky files that have been updated." \
240+
2 "Replace All - Moves current '~/allsky' to '~/allsky-OLD'." \
241+
3>&1 1>&2 2>&3)"
242+
else
243+
RESPONSE=1
244+
fi
245+
246+
if [[ ${RESPONSE} == "1" ]]; then
247+
IN_PLACE="true"
248+
else
249+
IN_PLACE="false"
250+
fi
235251

236252
if [[ ${IN_PLACE} == "true" ]]; then
237253
display_msg --log progress "Stopping Allsky"
@@ -320,8 +336,9 @@ IN_PLACE="true" # TODO: XXXXXXXXXXXXXXXX prompt for it
320336

321337
# --doUpgrade tells it to use prior version without asking and to not display header,
322338
# change messages to say "upgrade", not "install", etc.
339+
# TODO: used "exec" ?
323340
# shellcheck disable=SC2086,SC2291
324-
echo xxx ./install.sh ${DEBUG_ARG} --branch "${BRANCH}" --doUpgrade
341+
./install.sh ${DEBUG_ARG} --branch "${BRANCH}" --doUpgrade
325342
fi
326343

327344
elif [[ ${ACTION} == "doUpgrade" ]]; then

0 commit comments

Comments
 (0)