diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9a8d5af..23653a92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/src/scripts/npm/updateIosSdk.sh b/src/scripts/npm/updateIosSdk.sh index 801a98a5..6521f76d 100755 --- a/src/scripts/npm/updateIosSdk.sh +++ b/src/scripts/npm/updateIosSdk.sh @@ -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 @@ -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 \ No newline at end of file +# 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 "/' '{}' + \ No newline at end of file