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
on:
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test_channel:
runs-on: ${{ matrix.operating-system }}

View file

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