-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reusable download framework script (#564)
* Download Fabric and Stripe SDKs using a reusable script. * Improve indentation * Move URL to env var * Use new sdk cache key * Cache stripe sdk * Always store stripe version in text file for checksum * Fix copy-paste typo * Consistency fix
- Loading branch information
1 parent
01960ec
commit 4f54b49
Showing
3 changed files
with
131 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
SDK_NAME=$1 | ||
SDK_VERSION=$2 | ||
URL=$3 | ||
FRAMEWORK_DIR=Frameworks/$SDK_NAME | ||
VERSION_FILE=$FRAMEWORK_DIR/version | ||
CURRENT_SDK_VERSION=first | ||
|
||
if [ -e $VERSION_FILE ]; then \ | ||
while read value; do | ||
CURRENT_SDK_VERSION=$value | ||
done < $VERSION_FILE | ||
fi | ||
|
||
URL=${URL//INSERT_SDK_VERSION/"$SDK_VERSION"} | ||
|
||
if [ "$SDK_VERSION" != "$CURRENT_SDK_VERSION" ]; then \ | ||
echo "Downloading $SDK_NAME v$SDK_VERSION"; \ | ||
mkdir -p Frameworks/$SDK_NAME; \ | ||
curl -N -L -o framework.zip $URL; \ | ||
unzip -o framework.zip -d Frameworks/$SDK_NAME; \ | ||
rm framework.zip; \ | ||
fi | ||
if [ -e Frameworks/$SDK_NAME/$SDK_NAME.framework ]; then \ | ||
echo "$SDK_VERSION" > $VERSION_FILE; \ | ||
fi |