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

Download and unzip to temp folder and not $HOME

This commit is contained in:
Peter Leibiger 2022-02-03 23:50:07 +01:00
parent d5878a0492
commit 36e70a6528
No known key found for this signature in database
GPG key ID: 855A3ADD4CC39135

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