From c33c37022b3aac486cc5e7aea5c7f6b8b0f421e1 Mon Sep 17 00:00:00 2001 From: Daren Hayward <54070183+darhaywa@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:50:15 +0000 Subject: [PATCH] Extract to a temporary location to enable moving of flutter folder. (#227) --- setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 272e1df..64b0a5e 100755 --- a/setup.sh +++ b/setup.sh @@ -48,13 +48,15 @@ download_archive() { mkdir -p "$2" if [[ "$archive_name" == *zip ]]; then - unzip -q -o "$archive_local" -d "$RUNNER_TEMP" - # Remove the folder again so that the move command can do a simple rename + EXTRACT_PATH="$RUNNER_TEMP/_unzip_temp" + unzip -q -o "$archive_local" -d "$EXTRACT_PATH" + # Remove the folder again so that the move command can do a simple rename\ # instead of moving the content into the target folder. # This is a little bit of a hack since the "mv --no-target-directory" # linux option is not available here rm -r "$2" - mv "$RUNNER_TEMP"/flutter "$2" + mv "$EXTRACT_PATH"/flutter "$2" + rm -r "$EXTRACT_PATH" else tar xf "$archive_local" -C "$2" --strip-components=1 fi