Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix temp folder handling on windows #134

Merged
merged 1 commit into from Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/workflow.yml
@@ -1,5 +1,12 @@
name: Main workflow
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test_channel:
runs-on: ${{ matrix.operating-system }}
Expand Down
14 changes: 9 additions & 5 deletions setup.sh
Expand Up @@ -52,11 +52,17 @@ download_archive() {

curl --connect-timeout 15 --retry 5 $archive_url >$archive_local

# Create the target folder
mkdir -p "$2"

if [[ $archive_name == *zip ]]; then
unzip -q -o "$archive_local" -d "$RUNNER_TEMP"
shopt -s dotglob
mv ${RUNNER_TEMP}/flutter/* "$2"
shopt -u dotglob
# 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"
else
tar xf "$archive_local" -C "$2" --strip-components=1
fi
Expand Down Expand Up @@ -90,8 +96,6 @@ else
PUB_CACHE="${HOME}/.pub-cache"
fi

mkdir -p "$SDK_CACHE"

if [[ ! -x "${SDK_CACHE}/bin/flutter" ]]; then
if [[ $CHANNEL == master ]]; then
git clone -b master https://github.com/flutter/flutter.git "$SDK_CACHE"
Expand Down