From f0cc0311e06868556b3d04bb0d09733494ccebb8 Mon Sep 17 00:00:00 2001 From: Alif Rachmawadi Date: Thu, 31 Mar 2022 12:45:08 +0700 Subject: [PATCH] update .pub-cache location --- .github/workflows/workflow.yml | 3 +-- setup.sh | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 728fe5e..1bb4875 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,12 +1,11 @@ name: Main workflow -on: +on: push: branches: - main pull_request: branches: - main - jobs: test_channel: runs-on: ${{ matrix.operating-system }} diff --git a/setup.sh b/setup.sh index d6b0850..abb7c61 100755 --- a/setup.sh +++ b/setup.sh @@ -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