-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfetch-libraries.sh
executable file
·45 lines (34 loc) · 1.01 KB
/
fetch-libraries.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
VERSION=v0.3.2-alpha
ANDROID_ZIP_NAME=lnc-$VERSION-android.zip
IOS_ZIP_NAME=lnc-$VERSION-ios.zip
ZIP_PATH=https://github.com/lightninglabs/lightning-node-connect/releases/download/$VERSION/
ANDROID_ZIP_LINK=$ZIP_PATH$ANDROID_ZIP_NAME
IOS_ZIP_LINK=$ZIP_PATH$IOS_ZIP_NAME
# test that curl and unzip are installed
if ! command -v curl &> /dev/null
then
echo "curl could not be found. Please install it and run the script again."
exit
fi
if ! command -v unzip &> /dev/null
then
echo "unzip could not be found. Please install it and run the script again."
exit
fi
# delete old instances of library files
rm -rf android/libs/
rm -rf ios/Lncmobile.xcframework/
# create temp dir
mkdir tmp
# download LNC library files
curl -L $ANDROID_ZIP_LINK > tmp/android.zip
curl -L $IOS_ZIP_LINK > tmp/ios.zip
# unzip LNC library files
unzip tmp/android.zip -d tmp/
unzip tmp/ios.zip -d tmp/
# move LNC library files into place
mkdir -p android/libs/
mv tmp/android/* android/libs/
mv tmp/ios/* ios/
# delete temp dir
rm -rf tmp