forked from tari-project/wallet-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_dependencies.sh
47 lines (42 loc) · 1.48 KB
/
update_dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
FILE=env.json
if test ! -f "$FILE"; then
echo "$FILE does not exist. Creating default."
cp env-example.json env.json
echo "Please adjust env.json as needed."
fi
echo "\n\n***Pulling latest Tari lib build***"
source dependencies.env
if [[ -z "$FFI_VERSION" ]]; then
FFI_FILE="${1:-$(curl -s --compressed "https://www.tari.com/downloads/" | egrep -o 'libtari_wallet_ffi-ios-[0-9\.]+.tar.gz' | sort -V | tail -1)}"
else
FFI_FILE="libwallet-ios-$FFI_VERSION.tar.gz"
fi
# curl -s "https://www.tari.com/binaries/$FFI_FILE" | tar xz - -C MobileWallet/TariLib/ --exclude wallet.h
curl -s "https://tari-binaries.s3.amazonaws.com/libwallet/$FFI_FILE" | tar xz
mv "libwallet-ios-$FFI_VERSION/libtari_wallet_ffi.a" MobileWallet/TariLib/
mv "libwallet-ios-$FFI_VERSION/wallet.h" MobileWallet/TariLib/
# Check for cocoapods and install if missing.
if hash pod 2>/dev/null; then
echo "Cool, you have pods installed."
else
echo "You need cocoapods. Would you like it installed?"
read -e -p "y or n? " yn
if [[ "y" = "$yn" || "Y" = "$yn" ]]; then
sudo gem install cocoapods
fi
fi
# Check for carthage and install if missing.
if hash carthage 2>/dev/null; then
echo "Cool, you have carthage installed."
else
echo "You need carthage. Would you like it installed?"
read -e -p "y or n? " yn
if [[ "y" = "$yn" || "Y" = "$yn" ]]; then
brew install carthage
fi
fi
echo "\n\n***Updating pods***"
pod install
echo "\n\n***Updating carthage***"
carthage update --platform iOS