forked from datso/react-native-pjsip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libs.sh
executable file
·33 lines (27 loc) · 673 Bytes
/
libs.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
#!/bin/bash
set -e
VERSION="v2.8.0"
URL="https://github.com/datso/react-native-pjsip-builder/releases/download/${VERSION}/release.tar.gz"
LOCK=".libs.lock"
DEST="release.tar.gz"
DOWNLOAD=true
if ! type "curl" > /dev/null; then
echo "Missed curl dependency" >&2;
exit 1;
fi
if ! type "tar" > /dev/null; then
echo "Missed tar dependency" >&2;
exit 1;
fi
if [ -f ${LOCK} ]; then
CURRENT_VERSION=$(cat ${LOCK})
if [ "${CURRENT_VERSION}" == "${VERSION}" ];then
DOWNLOAD=false
fi
fi
if [ "$DOWNLOAD" = true ]; then
curl -LO --silent "${URL}" -o "${DEST}"
tar -xvf "${DEST}"
rm -f "${DEST}"
echo "${VERSION}" > ${LOCK}
fi