From d3a20821c5557cdc639b4f59aff2020caf013644 Mon Sep 17 00:00:00 2001 From: Jayana Gunaweera <79576139+JayanaGunaweera01@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:04:21 +0530 Subject: [PATCH] Update migration-script-ubuntu.sh --- .../ubuntu-os/migration-script-ubuntu.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 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 3023739297c..90cd766a403 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 @@ -101,18 +101,6 @@ access_token=$(curl --location --request POST 'https://oauth2.googleapis.com/tok --data-urlencode 'refresh_token='$gcpRefreshToken'' \ --data-urlencode 'grant_type=refresh_token' | jq -r '.access_token') -# Check if the response contains any error message -if echo "$access_token" | grep -q '"error":'; then - # If there is an error, print the failure message with the error description - error_description=$(echo "$access_token" | jq -r '.error_description') - echo -e "${RED}${BOLD}Failure in generating an access token $error_description${NC}" -else - # If there is no error, print the success message - echo -e "${PURPLE}${BOLD}Success: An access token generated successfully.${NC}" - # Save the access token to a file called "access_token" - echo "$access_token" > access_token -fi - # Specify the Google Drive file URL file_url="$urlOld" @@ -121,7 +109,7 @@ file_id=$(echo "$file_url" | awk -F'/' '{print $NF}' | awk -F'=' '{print $2}') # Download the file using the access token from the "access_token" file access_token=$(cat access_token) -response=$(curl "https://www.googleapis.com/drive/v3/files/1pePZJM0gIFlPft8qSsu4613kiVzuLQHs?alt=media" \ +response=$(curl "https://www.googleapis.com/drive/v3/files/$file_id?alt=media" \ --header "Authorization: Bearer $access_token" \ --header "Accept: application/json" \ --compressed -O wso2is.zip)