diff --git a/images/linux/scripts/installers/pipx-packages.sh b/images/linux/scripts/installers/pipx-packages.sh index 5f908b9f..0743b89b 100644 --- a/images/linux/scripts/installers/pipx-packages.sh +++ b/images/linux/scripts/installers/pipx-packages.sh @@ -11,17 +11,18 @@ toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" pipx_packages=$(jq ".pipx[] .package" $toolset) for package in $pipx_packages; do - python_path=$(jq ".pipx[] | select(.package == $package) .python" $toolset) - if [ "$python_path" = "default" ]; then - echo "Install $package into default python" - pipx install $package - else + python_version=$(jq -r ".pipx[] | select(.package == $package) .python" $toolset) + if [ "$python_version" != "null" ]; then + python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" echo "Install $package into python $python_path" pipx install $package --python $python_path + else + echo "Install $package into default python" + pipx install $package fi # Run tests to determine that the software installed as expected - cmd=$(jq ".pipx[] | select(.package == $package) .cmd" $toolset) + cmd=$(jq -r ".pipx[] | select(.package == $package) .cmd" $toolset) if ! command -v $cmd; then echo "$package was not installed" exit 1 diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 10b5fb75..94abdafb 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -192,12 +192,11 @@ "pipx": [ { "package": "yamllint", - "python": "default", "cmd": "yamllint" }, { "package": "aws-sam-cli", - "python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7", + "python": "3.7", "cmd": "sam" } ] diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index 00f888c6..73f76c64 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -155,12 +155,11 @@ "pipx": [ { "package": "yamllint", - "python": "default", "cmd": "yamllint" }, { "package": "aws-sam-cli", - "python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7", + "python": "3.7", "cmd": "sam" } ]