1
0
Fork 0
mirror of https://github.com/subosito/flutter-action.git synced 2024-08-16 10:19:50 +02:00

Merge pull request #132 from kuhnroyal/temp-folder

Download and unzip to temp folder and not $HOME
This commit is contained in:
Alif Rachmawadi 2022-02-04 17:24:54 +07:00 committed by GitHub
commit 77740fc108
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,14 +48,14 @@ get_version_manifest() {
download_archive() {
archive_url="$MANIFEST_BASE_URL/$1"
archive_name=$(basename $1)
archive_local="$HOME/$archive_name"
archive_local="$RUNNER_TEMP/$archive_name"
curl --connect-timeout 15 --retry 5 $archive_url >$archive_local
if [[ $archive_name == *zip ]]; then
unzip -q -o "$archive_local" -d "$HOME"
unzip -q -o "$archive_local" -d "$RUNNER_TEMP"
shopt -s dotglob
mv ${HOME}/flutter/* "$2"
mv ${RUNNER_TEMP}/flutter/* "$2"
shopt -u dotglob
else
tar xf "$archive_local" -C "$2" --strip-components=1