forked from sarriaroman/FabricPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-packages.sh
executable file
·41 lines (33 loc) · 1.24 KB
/
add-packages.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
#!/bin/bash
#
# add-packages.sh
#
# Installs Fabric and Crashlytics packages.
# Versions defined in package.json
#
# Requires `jq` (OSX: `brew install jq`)
FABRIC_VERSION=$(cat package.json | jq -r '.packages.fabric')
CRASH_VERSION=$(cat package.json | jq -r '.packages.crashlytics')
echo "Adding packages from package.json:"
echo "Fabric version $FABRIC_VERSION"
echo "Crashlytics version $CRASH_VERSION"
# Create ./tmp/ and download packages
echo "Creating ./tmp/, downloading packages..."
rm -rf ./tmp/
mkdir -p ./tmp/
curl -o ./tmp/fabric.zip "https://kit-downloads.fabric.io/cocoapods/fabric/$FABRIC_VERSION/fabric.zip"
curl -o ./tmp/crashlytics.zip "https://kit-downloads.fabric.io/cocoapods/crashlytics/$CRASH_VERSION/crashlytics.zip"
# Unzip targets
echo "Extracting frameworks..."
unzip -qq ./tmp/fabric.zip -d ./tmp/fabric
unzip -qq ./tmp/crashlytics.zip -d ./tmp/crashlytics
# Clean destination
echo "Cleaning destination ./lib/ios/ ..."
rm -rf ./lib/ios/Crashlytics.framework ./lib/ios/Fabric.framework
# Move files
echo "Transferring frameworks to ./lib/ios/ ..."
mv ./tmp/crashlytics/iOS/Crashlytics.framework ./tmp/fabric/iOS/Fabric.framework ./lib/ios/
# Cleanup
echo "Cleaning temp directory..."
rm -rf ./tmp/
echo "Package install complete!"