Skip to content

Commit

Permalink
update .pub-cache location
Browse files Browse the repository at this point in the history
  • Loading branch information
subosito committed Mar 31, 2022
1 parent 5e1529b commit f0cc031
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Main workflow
on:
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test_channel:
runs-on: ${{ matrix.operating-system }}
Expand Down
11 changes: 4 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,20 @@ 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

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
Expand Down

0 comments on commit f0cc031

Please sign in to comment.