update .pub-cache location

This commit is contained in:
Alif Rachmawadi
2022-03-31 12:45:08 +07:00
parent 5e1529bc12
commit f0cc0311e0
2 changed files with 5 additions and 9 deletions

View File

@@ -6,7 +6,6 @@ on:
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