Skip to content

Commit

Permalink
style: cleaned up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 8, 2017
1 parent e41ace2 commit e15ee8f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/scripts/npm/updateIosSdk.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
#!/bin/bash

#update the ios dependencies in this directory to those storied under passed tag on github
# update the iOS dependencies in this directory to those storied under passed tag on Github

#fail fast on errors
# fail fast on errors
set -e

#cd into directory containing this script
# cd into directory containing this script
cd "$(dirname "$0")"

#check first parameter is set to tag to download
if [ -z ${1+x} ]; then
echo "You must pass this script the tag to download"
exit -1
# check first parameter is set to tag to download
else
echo "downloading tag '$1'"
fi

#this is the git tag that we'll be updating to,
#we expecct it to be the first parameter to this script
# this is the git tag that we will be updating to
# we expect it to be the first parameter to this script
tag_name=$1
tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip"
#extract is where we stick the extracted archive of the tag
tag_extract=ios-branch-deep-linking-$tag_name

# extract is where we stick the extracted archive of the tag
tag_extract=ios-branch-deep-linking-$tag_name

#check that tag exists
tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url`
if [ $tag_url_status = "200" ]; then
echo "found tag"
Expand All @@ -34,29 +34,31 @@ else
exit -1
fi

#this will overwripte existing versions of sdk.zip
curl -L -o sdk.zip $tag_url

#delete old extracted content or do nothing if we don't have any
rm -rf $tag_extract
# this will overwrite existing versions of sdk.zip

#silently (-q) extract download
unzip -q -x sdk.zip
rm -f sdk.zip
# delete old extracted content or do nothing if we don't have any

#copy in new dependencies
rm -rf Branch-SDK
mv $tag_extract/Branch-SDK/Branch-SDK .
# silently (-q) extract download

rm -rf Branch.framework
mv $tag_extract/Branch.framework .
# remove

rm -rf Fabric
mv $tag_extract/Branch-SDK/Fabric .
# copy in new dependencies

#clean up
rm -rf $tag_extract
# clean up extract

#replace all instances of '#import "../Fabric/' with '#import "' in .m files
find . -type f -name '*.m' \
-exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' +
-exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' +

0 comments on commit e15ee8f

Please sign in to comment.