add download preinstall step

This commit is contained in:
rsudekum
2015-04-28 10:38:09 -07:00
parent 7a70e46888
commit 0aeee37899
3 changed files with 19 additions and 1 deletions
+3
View File
@@ -28,3 +28,6 @@ Pods/
#
node_modules/
npm-debug.log
# project specific
libMapboxGL.a
+2 -1
View File
@@ -10,7 +10,8 @@
],
"private": false,
"scripts": {
"start": "node_modules/react-native/packager/packager.sh"
"start": "node_modules/react-native/packager/packager.sh",
"preinstall": "./scripts/download-mapbox-gl-native-ios.sh 0.2.16"
},
"dependencies": {
"react-native": "^0.4.1"
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
VERSION=$1
if ! which curl > /dev/null; then echo "curl command not found. Please install curl"; exit 1; fi;
if ! which unzip > /dev/null; then echo "unzip command not found. Please install unzip"; exit 1; fi;
mkdir temp
curl -sS http://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-gl-ios-$VERSION.zip > temp.zip
unzip -o temp.zip -d temp
mv libMapboxGL.a .
rm -r temp
rm temp.zip