fix syntax errors in decred script (#2109)

* fix syntax errors in decred script * [skip ci] fix typo in error message

cyan committed Mar 26, 2025 at 02:49 UTC 18049308df20175e69f5950c1eea53d4ccbb1440
2 files changed +10 -10
scripts/android/build_decred.sh
+5 -5
@@ -1,4 +1,4 @@
1 -#!/bin/sh
1 +#!/bin/bash
2
3 set -e
4 cd "$(dirname "$0")"
@@ -9,8 +9,8 @@ LIBWALLET_PATH="${PWD}/decred/libwallet"
9 LIBWALLET_URL="https://github.com/decred/libwallet.git"
10 LIBWALLET_VERSION="dba5327d35cb5d5d1ff113b780869deee154511f"
11
12 -if [ -e $LIBWALLET_PATH ]; then
13 - rm -fr $LIBWALLET_PATH/{*,.*} || true
12 +if [[ -e $LIBWALLET_PATH ]]; then
13 + rm -fr $LIBWALLET_PATH || true
14 fi
15 mkdir -p $LIBWALLET_PATH || true
16
@@ -32,7 +32,7 @@ then
32 echo "You have these versions installed on your system currently:"
33 ls ${ANDROID_HOME}/ndk/ | cat | awk '{ print "- " $1 }'
34 echo "echo > ~/.zprofile"
35 - echo "echo 'export ANDROID_NDK_CERSION=..... > ~/.zprofile"
35 + echo "echo 'export ANDROID_NDK_VERSION=..... > ~/.zprofile"
36 exit 1
37 fi
38
@@ -65,7 +65,7 @@ do
65 esac
66
67 # PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
68 - if [ -e ./build ]; then
68 + if [[ -e ./build ]]; then
69 rm -fr ./build
70 fi
71
scripts/ios/build_decred.sh
+5 -5
@@ -1,12 +1,12 @@
1 -#!/bin/sh
1 +#!/bin/bash
2 set -e
3 . ./config.sh
4 LIBWALLET_PATH="${EXTERNAL_IOS_SOURCE_DIR}/libwallet"
5 LIBWALLET_URL="https://github.com/decred/libwallet.git"
6 LIBWALLET_VERSION="dba5327d35cb5d5d1ff113b780869deee154511f"
7
8 -if [ -e $LIBWALLET_PATH ]; then
9 - rm -fr $LIBWALLET_PATH
8 +if [[ -e $LIBWALLET_PATH ]]; then
9 + rm -fr $LIBWALLET_PATH
10 fi
11 mkdir -p $LIBWALLET_PATH
12 git clone $LIBWALLET_URL $LIBWALLET_PATH
@@ -17,8 +17,8 @@ SYSROOT=`xcrun --sdk iphoneos --show-sdk-path`
17 CLANG="clang -target arm64-apple-ios -isysroot ${SYSROOT}"
18 CLANGXX="clang++ -target arm64-apple-ios -isysroot ${SYSROOT}"
19
20 -if [ -e ./build ]; then
21 - rm -fr ./build
20 +if [[ -e ./build ]]; then
21 + rm -fr ./build
22 fi
23 CGO_ENABLED=1 GOOS=ios GOARCH=arm64 CC=$CLANG CXX=$CLANGXX \
24 go build -v -buildmode=c-archive -o ./build/libdcrwallet.a ./cgo || exit 1