mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
add -i
flag for dev convenience so build all isn't run when not required
This commit is contained in:
parent
46a5548cb8
commit
9d872754ef
1 changed files with 38 additions and 14 deletions
|
@ -13,27 +13,49 @@ usage() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
# check for required number of args
|
||||
if [ $# -ne 8 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# required args
|
||||
unset -v APP_VERSION_STRING
|
||||
unset -v APP_BUILD_NUMBER
|
||||
unset -v APP_BUILD_PLATFORM
|
||||
unset -v APP_NAMED_ID
|
||||
|
||||
# optional args (with defaults)
|
||||
BUILD_CRYPTO_PLUGINS=0
|
||||
|
||||
# Parse command-line arguments.
|
||||
while getopts "v:b:p:a:" opt; do
|
||||
case "$opt" in
|
||||
while getopts "v:b:p:a:i" opt; do
|
||||
case "${opt}" in
|
||||
v) APP_VERSION_STRING="$OPTARG" ;;
|
||||
b) APP_BUILD_NUMBER="$OPTARG" ;;
|
||||
p) APP_BUILD_PLATFORM="$OPTARG" ;;
|
||||
a) APP_NAMED_ID="$OPTARG" ;;
|
||||
i) BUILD_CRYPTO_PLUGINS=1 ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$APP_VERSION_STRING" ]; then
|
||||
echo "Missing -v option"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$APP_BUILD_NUMBER" ]; then
|
||||
echo "Missing -b option"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$APP_BUILD_PLATFORM" ]; then
|
||||
echo "Missing -p option"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$APP_NAMED_ID" ]; then
|
||||
echo "Missing -a option"
|
||||
usage
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if printf '%s\0' "${APP_PLATFORMS[@]}" | grep -Fxqz -- "${APP_BUILD_PLATFORM}"; then
|
||||
pushd "${APP_PROJECT_ROOT_DIR}/scripts/${APP_BUILD_PLATFORM}"
|
||||
else
|
||||
|
@ -51,13 +73,15 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$APP_NAMED_ID" = "stack_wallet" ]]; then
|
||||
./build_all.sh
|
||||
elif [[ "$APP_NAMED_ID" = "stack_duo" ]]; then
|
||||
./build_all_duo.sh
|
||||
else
|
||||
echo "Invalid app id: ${APP_NAMED_ID}"
|
||||
exit 1
|
||||
if [ "$BUILD_CRYPTO_PLUGINS" -eq 0 ]; then
|
||||
if [[ "$APP_NAMED_ID" = "stack_wallet" ]]; then
|
||||
./build_all.sh
|
||||
elif [[ "$APP_NAMED_ID" = "stack_duo" ]]; then
|
||||
./build_all_duo.sh
|
||||
else
|
||||
echo "Invalid app id: ${APP_NAMED_ID}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
popd
|
||||
|
|
Loading…
Reference in a new issue