feat: retry download when decompression fails #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Motivation, issues
This PR closes #70 by addressing an issue where the Google Cloud SDK installation fails with an error related to a corrupt tar archive. This problem prevents users from successfully installing and using the Google Cloud SDK in their projects.
Description
This PR modifies the installation script to introduce two new functions,
download_and_extract()
anddownload_with_retry()
. These functions improve the process of downloading and extracting the Google Cloud SDK tar file by implementing retries when download failures occur.The
download_and_extract()
function is responsible for downloading the tar file and extracting it to the specified installation directory. Thedownload_with_retry()
function wraps around thedownload_and_extract()
function and retries the download process up to three times if a failure occurs.These new functions are utilized in the installation script to improve the reliability of the installation process, reducing the chances of encountering the "unexpected end of file" error during Google Cloud SDK installation.
The updated script also includes additional error handling and messages to provide clearer feedback to the user in case of any issues during the installation process.