From 5fb02d2eb25bf3554e98ab441760cca24a635a3d Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 23 May 2024 11:53:11 -0600 Subject: [PATCH] add interactive confirmation regarding version and build numbers --- scripts/build_app.sh | 17 ++++++++++++++++- scripts/env.sh | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/build_app.sh b/scripts/build_app.sh index c7198fda5..9901b3cb7 100755 --- a/scripts/build_app.sh +++ b/scripts/build_app.sh @@ -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 and 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}" diff --git a/scripts/env.sh b/scripts/env.sh index d47b6f2f4..d938356c4 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -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 )