Add pypy and pypy3 to PATH during tools cache download

This commit is contained in:
Konrad Pabjan
2019-12-17 15:56:28 -05:00
parent 0238175c96
commit 956716dc9a
3 changed files with 19 additions and 1 deletions

View File

@@ -37,6 +37,15 @@ done;
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy) pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
for pypy in $pypys; do for pypy in $pypys; do
DocumentInstalledItemIndent "PyPy $pypy" DocumentInstalledItemIndent "PyPy $pypy"
# Add symlinks for pypy2 and pypy3 to usr/local/bin, there should only be 2 versions of PyPy in the tools cache that is downloaded
if [ ${pypy:0:1} -eq "3" ] ; then
# add pypy 3.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy3 /usr/local/bin/pypy3
else
# add pypy 2.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy /usr/local/bin/pypy
fi
done; done;
DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)" DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)"

View File

@@ -37,6 +37,15 @@ done;
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy) pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
for pypy in $pypys; do for pypy in $pypys; do
DocumentInstalledItemIndent "PyPy $pypy" DocumentInstalledItemIndent "PyPy $pypy"
# Add symlinks for pypy2 and pypy3 to usr/local/bin, there should only be 2 versions of PyPy in the tools cache that is downloaded
if [ ${pypy:0:1} -eq "3" ] ; then
# add pypy 3.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy3 /usr/local/bin/pypy3
else
# add pypy 2.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy /usr/local/bin/pypy
fi
done; done;
DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)" DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)"

View File

@@ -12,7 +12,7 @@ apt-get install -y --no-install-recommends python python-dev python-pip python3
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in python python3; do for cmd in python pip python3 pip3; do
if ! command -v $cmd; then if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH" echo "$cmd was not installed or not found on PATH"
exit 1 exit 1