Skip to content

Commit 989c094

Browse files
authored
Fix pub cache issue in Windows (#39)
1 parent e431f4b commit 989c094

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

example/pubspec.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: example
22
publish_to: none
33
environment:
4-
sdk: '>=2.12.0 <3.0.0'
4+
sdk: ">=2.12.0 <3.0.0"
5+
6+
dependencies:
7+
characters:
8+
git: https://github.com/dart-lang/characters
9+
510
dev_dependencies:
611
test: any

setup.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,17 @@ fi
8585
rm "${HOME}/dartsdk.zip"
8686

8787
# Configure pub to use a fixed location.
88-
echo "PUB_CACHE=${HOME}/.pub-cache" >> $GITHUB_ENV
88+
if [[ $OS == windows ]]
89+
then
90+
PUBCACHE="${USERPROFILE}\\.pub-cache"
91+
else
92+
PUBCACHE="${HOME}/.pub-cache"
93+
fi
94+
echo "PUB_CACHE=${PUBCACHE}" >> $GITHUB_ENV
95+
echo "Pub cache set to: ${PUBCACHE}"
8996

9097
# Update paths.
91-
echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH
98+
echo "${PUBCACHE}/bin" >> $GITHUB_PATH
9299
echo "${RUNNER_TOOL_CACHE}/dart-sdk/bin" >> $GITHUB_PATH
93100

94101
# Report success, and print version.

0 commit comments

Comments
 (0)