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

update .pub-cache location

This commit is contained in:
Alif Rachmawadi 2022-03-31 12:45:08 +07:00
parent 5e1529bc12
commit f0cc0311e0
No known key found for this signature in database
GPG key ID: 3B51F08DD3ED2195
2 changed files with 5 additions and 9 deletions

View file

@ -1,12 +1,11 @@
name: Main workflow name: Main workflow
on: on:
push: push:
branches: branches:
- main - main
pull_request: pull_request:
branches: branches:
- main - main
jobs: jobs:
test_channel: test_channel:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}

View file

@ -78,11 +78,11 @@ transform_path() {
fi fi
} }
SDK_CACHE="" CACHE_PATH=""
while getopts 'c:' flag; do while getopts 'c:' flag; do
case "${flag}" in case "${flag}" in
c) SDK_CACHE="$(transform_path $OPTARG)" ;; c) CACHE_PATH="$OPTARG" ;;
?) exit 2 ;; ?) exit 2 ;;
esac esac
done done
@ -90,11 +90,8 @@ done
CHANNEL="${@:$OPTIND:1}" CHANNEL="${@:$OPTIND:1}"
VERSION="${@:$OPTIND+1:1}" VERSION="${@:$OPTIND+1:1}"
if [[ $OS_NAME == windows ]]; then SDK_CACHE="$(transform_path ${CACHE_PATH})"
PUB_CACHE="${USERPROFILE}\\.pub-cache" PUB_CACHE="$(transform_path ${CACHE_PATH}/.pub-cache)"
else
PUB_CACHE="${HOME}/.pub-cache"
fi
if [[ ! -x "${SDK_CACHE}/bin/flutter" ]]; then if [[ ! -x "${SDK_CACHE}/bin/flutter" ]]; then
if [[ $CHANNEL == master ]]; then if [[ $CHANNEL == master ]]; then