diff --git a/scripts/android/build_decred.sh b/scripts/android/build_decred.sh index fee8e9af8..75ed45aca 100755 --- a/scripts/android/build_decred.sh +++ b/scripts/android/build_decred.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e cd "$(dirname "$0")" @@ -9,8 +9,8 @@ LIBWALLET_PATH="${PWD}/decred/libwallet" LIBWALLET_URL="https://github.com/decred/libwallet.git" LIBWALLET_VERSION="dba5327d35cb5d5d1ff113b780869deee154511f" -if [ -e $LIBWALLET_PATH ]; then - rm -fr $LIBWALLET_PATH/{*,.*} || true +if [[ -e $LIBWALLET_PATH ]]; then + rm -fr $LIBWALLET_PATH || true fi mkdir -p $LIBWALLET_PATH || true @@ -32,7 +32,7 @@ then echo "You have these versions installed on your system currently:" ls ${ANDROID_HOME}/ndk/ | cat | awk '{ print "- " $1 }' echo "echo > ~/.zprofile" - echo "echo 'export ANDROID_NDK_CERSION=..... > ~/.zprofile" + echo "echo 'export ANDROID_NDK_VERSION=..... > ~/.zprofile" exit 1 fi @@ -65,7 +65,7 @@ do esac # PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}" - if [ -e ./build ]; then + if [[ -e ./build ]]; then rm -fr ./build fi diff --git a/scripts/ios/build_decred.sh b/scripts/ios/build_decred.sh index 78c36690b..6860c7776 100755 --- a/scripts/ios/build_decred.sh +++ b/scripts/ios/build_decred.sh @@ -1,12 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e . ./config.sh LIBWALLET_PATH="${EXTERNAL_IOS_SOURCE_DIR}/libwallet" LIBWALLET_URL="https://github.com/decred/libwallet.git" LIBWALLET_VERSION="dba5327d35cb5d5d1ff113b780869deee154511f" -if [ -e $LIBWALLET_PATH ]; then - rm -fr $LIBWALLET_PATH +if [[ -e $LIBWALLET_PATH ]]; then + rm -fr $LIBWALLET_PATH fi mkdir -p $LIBWALLET_PATH git clone $LIBWALLET_URL $LIBWALLET_PATH @@ -17,8 +17,8 @@ SYSROOT=`xcrun --sdk iphoneos --show-sdk-path` CLANG="clang -target arm64-apple-ios -isysroot ${SYSROOT}" CLANGXX="clang++ -target arm64-apple-ios -isysroot ${SYSROOT}" -if [ -e ./build ]; then - rm -fr ./build +if [[ -e ./build ]]; then + rm -fr ./build fi CGO_ENABLED=1 GOOS=ios GOARCH=arm64 CC=$CLANG CXX=$CLANGXX \ go build -v -buildmode=c-archive -o ./build/libdcrwallet.a ./cgo || exit 1