From 72135a6f89489cc90c76586630a2ab10bd972ded Mon Sep 17 00:00:00 2001 From: Jayana Gunaweera <79576139+JayanaGunaweera01@users.noreply.github.com> Date: Tue, 27 Jun 2023 11:18:03 +0530 Subject: [PATCH] Update migration-script-ubuntu.sh --- .../ubuntu-os/migration-script-ubuntu.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh b/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh index 188fb88188a..9f6b9743a36 100644 --- a/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh +++ b/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh @@ -98,10 +98,19 @@ api_key="$migrationApiKey" echo "Downloading using API key.." +# Download the file and save it with a temporary name curl -H "Authorization: Bearer $migrationApiKey" \ "https://www.googleapis.com/drive/v3/files/$file_id?alt=media" \ - -o wso2is.zip -wait $! + -o wso2is_temp.zip + +# Check if the download was successful +if [ $? -eq 0 ]; then + # Rename the temporary file to wso2is.zip + mv wso2is_temp.zip wso2is.zip + echo "Download completed successfully." +else + echo "Error occurred while downloading the file." +fi unzip -qq *.zip & wait $!