add interactive confirmation regarding version and build numbers

This commit is contained in:
julian 2024-05-23 11:53:11 -06:00
parent cf7433655c
commit 5fb02d2eb2
2 changed files with 17 additions and 2 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -x -e
set -e
source ./env.sh
@ -13,6 +13,18 @@ usage() {
exit 1
}
confirmDisclaimer() {
while true; do
# shellcheck disable=SC2162
read -p "Please confirm you understand that when using certain values for <version> and <build_number> there is a chance that the resulting app WILL DELETE CRITICAL WALLET DATA. Are you sure you want to continue? (yes/no): " response
case $response in
[Yy][Ee][Ss] ) echo "Continuing..."; break;;
[Nn][Oo] ) exit 0;;
* ) echo "Invalid response";;
esac
done
}
# required args
unset -v APP_VERSION_STRING
unset -v APP_BUILD_NUMBER
@ -54,6 +66,9 @@ if [ -z "$APP_NAMED_ID" ]; then
usage
fi
confirmDisclaimer
set -x
# checks for the correct platform dir and pushes it for later
if printf '%s\0' "${APP_PLATFORMS[@]}" | grep -Fxqz -- "${APP_BUILD_PLATFORM}"; then
pushd "${APP_PROJECT_ROOT_DIR}/scripts/${APP_BUILD_PLATFORM}"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -x -e
set -e
# set project root
THIS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )