Rework pipx toolset

This commit is contained in:
Vladimir Safonkin
2020-10-05 15:01:46 +03:00
parent d26db64941
commit 8750bf4011
3 changed files with 9 additions and 10 deletions

View File

@@ -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