Skip to content

Commit

Permalink
style: processed with bash linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 8, 2017
1 parent e15ee8f commit c07e58a
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/scripts/npm/updateIosSdk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/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
Expand All @@ -9,12 +8,12 @@ set -e
# cd into directory containing this script
cd "$(dirname "$0")"

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
if [ -z "${1+x}" ]; then
echo "You must pass this script the tag to download"
exit -1
else
echo "downloading tag '$1'"
echo "downloading tag '$1'"
fi

# this is the git tag that we will be updating to
Expand All @@ -25,18 +24,17 @@ tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_n
# extract is where we stick the extracted archive of the tag
tag_extract=ios-branch-deep-linking-$tag_name

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"
# 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"
else
echo "could not find '$tag_url'"
echo "curl returned status '$tag_url_status'"
exit -1
echo "could not find '$tag_url'"
echo "curl returned status '$tag_url_status'"
exit -1
fi

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

Expand All @@ -59,6 +57,5 @@ mv $tag_extract/Branch-SDK/Fabric .
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 "/' '{}' +# replace all instances of '#import "../Fabric/' with '#import "' in .m files

0 comments on commit c07e58a

Please sign in to comment.