From cf124fa95a3874aeb8e4e31a87068e2d782fffff Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Tue, 29 Oct 2024 21:03:33 +0800 Subject: [PATCH] Modify the script to report an error --- .github/ci/build/build_ios.sh | 6 ++++-- .github/ci/build/modify_podfile.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index ad5a5ac1d..e3931eb00 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -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 @@ -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 diff --git a/.github/ci/build/modify_podfile.py b/.github/ci/build/modify_podfile.py index c683915c7..8971a4c41 100644 --- a/.github/ci/build/modify_podfile.py +++ b/.github/ci/build/modify_podfile.py @@ -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 = ""