Skip to content

Commit

Permalink
style: relocated ios sdk update script
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 8, 2017
1 parent c07e58a commit 316ee2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ gulp prerelease;
> **[optional]** Update [iOS SDK](https://github.com/BranchMetrics/ios-branch-deep-linking/tags) (will need to update `plugin.xml` dependencies if new iOS files)
```sh
./src/scripts/npm/updateIosSdk/update.sh 0.13.5;
./src/scripts/npm/updateAndroidSdk/update.sh 2.5.9;
./src/scripts/npm/updateIosSdk.sh 0.13.5;
```

### Test
Expand Down
24 changes: 11 additions & 13 deletions src/scripts/npm/updateIosSdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -e

# cd into directory containing this script
cd "$(dirname "$0")"
path="../../ios/dependencies"

# check first parameter is set to tag to download
if [ -z "${1+x}" ]; then
Expand Down Expand Up @@ -34,28 +35,25 @@ else
exit -1
fi

curl -L -o sdk.zip $tag_url
rm -rf $tag_extract
# this will overwrite existing versions of sdk.zip
curl -L -o "$path"/sdk.zip "$tag_url"

unzip -q -x sdk.zip
rm -f sdk.zip
# delete old extracted content or do nothing if we don't have any
rm -rf "$tag_extract"

rm -rf Branch-SDK
mv $tag_extract/Branch-SDK/Branch-SDK .
# silently (-q) extract download
unzip -q -x "$path"/sdk.zip

rm -rf Branch.framework
mv $tag_extract/Branch.framework .
# remove
rm -rf "${path:?}"/*

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

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

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

0 comments on commit 316ee2c

Please sign in to comment.