From f75c0e6e4b33d1d070936b35d682b7c9efceaa4b Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Tue, 5 May 2020 12:07:17 +0100 Subject: [PATCH] There is no AGENT_TOOLSDIRECTORY on GitHub images (#21) This change reflects what the Windows installer already does: https://github.com/mjpieters/python-versions/blob/c0e7ef2c3c5b8e3dce50c0caceaafb4a5266a36c/installers/win-setup-template.ps1#L82-L87 --- installers/nix-setup-template.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/installers/nix-setup-template.sh b/installers/nix-setup-template.sh index ea9a14b6..87da49a7 100644 --- a/installers/nix-setup-template.sh +++ b/installers/nix-setup-template.sh @@ -9,7 +9,14 @@ PYTHON_MAJOR_DOT_MINOR=python$MAJOR_VERSION.$MINOR_VERSION PYTHON_MAJORMINOR=python$MAJOR_VERSION$MINOR_VERSION PYTHON_FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$BUILD_VERSION -PYTHON_TOOLCACHE_PATH=$AGENT_TOOLSDIRECTORY/Python +if [ -z ${AGENT_TOOLSDIRECTORY+x} ]; then + # No AGENT_TOOLSDIRECTORY on GitHub images + TOOLCACHE_ROOT=$RUNNER_TOOL_CACHE +else + TOOLCACHE_ROOT=$AGENT_TOOLSDIRECTORY +fi + +PYTHON_TOOLCACHE_PATH=$TOOLCACHE_ROOT/Python PYTHON_TOOLCACHE_VERSION_PATH=$PYTHON_TOOLCACHE_PATH/$PYTHON_FULL_VERSION PYTHON_TOOLCACHE_VERSION_ARCH_PATH=$PYTHON_TOOLCACHE_VERSION_PATH/x64 @@ -47,4 +54,4 @@ echo "Upgrading PIP..." ./python -m pip install --ignore-installed pip echo "Create complete file" -touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete \ No newline at end of file +touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete