Skip to content

Commit

Permalink
Modify the script to report an error
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhui committed Oct 29, 2024
1 parent 757ed01 commit cf124fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/ci/build/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ echo sdk_url: $sdk_url

zip_name=${sdk_url##*/}
echo zip_name: $zip_name

SDK_URL_IS_EMPTY=0
if [ "$sdk_url" != "" ]; then
SDK_URL_IS_EMPTY=1
echo "sdk_url: $sdk_url"
curl -o $zip_name $sdk_url || exit 1
7za x ./$zip_name -y > log.txt
Expand All @@ -72,12 +73,13 @@ if [ "$sdk_url" != "" ]; then
ls -al ./$unzip_name/samples/API-Example/
mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1
else
SDK_URL_IS_EMPTY=0
echo "sdk_url is empty!"
cp -rf ./iOS/${ios_direction} ./ || exit 1
fi

echo "work space1: $WORKSPACE"
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $sdk_url || exit 1
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $SDK_URL_IS_EMPTY || exit 1

7za a -tzip result.zip -r $unzip_name > log.txt
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
Expand Down
4 changes: 2 additions & 2 deletions .github/ci/build/modify_podfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os, sys

def modfiy(path, sdk_url):
def modfiy(path, sdk_url_is_empty):
with open(path, 'r', encoding='utf-8') as file:
contents = []
for num, line in enumerate(file):
if "pod 'Agora" in line:
if sdk_url != "":
if sdk_url_is_empty != "0":
line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n"
elif "pod 'sdk" in line:
line = ""
Expand Down

0 comments on commit cf124fa

Please sign in to comment.