Files
runner-images-sangeeth/images/linux/scripts/installers/pipx-packages.sh
T

30 lines
974 B
Bash
Raw Normal View History

2020-10-01 17:52:16 +03:00
#!/bin/bash
################################################################################
## File: pipx-packages.sh
## Desc: Install tools via pipx
################################################################################
2020-10-02 09:20:33 +03:00
2020-10-03 23:03:28 +03:00
export PATH="$PATH:/opt/pipx_bin"
2020-10-01 22:55:54 +03:00
2020-10-05 12:04:29 +03:00
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
2020-10-05 13:31:53 +03:00
pipx_packages=$(jq ".pipx[] .package" $toolset)
2020-10-01 17:52:16 +03:00
2020-10-05 12:04:29 +03:00
for package in $pipx_packages; do
2020-10-05 13:31:53 +03:00
python_path=$(jq ".pipx[] | select(.package == $package) .python" $toolset)
if [ "$python_path" = "default" ]; then
echo "Install $package into default python"
pipx install $package
else
echo "Install $package into python $python_path"
pipx install $package --python $python_path
fi
2020-10-05 12:04:29 +03:00
2020-10-05 13:41:50 +03:00
# Run tests to determine that the software installed as expected
cmd=$(jq ".pipx[] | select(.package == $package) .cmd" $toolset)
2020-10-05 12:04:29 +03:00
if ! command -v $cmd; then
2020-10-05 13:41:50 +03:00
echo "$package was not installed"
2020-10-01 17:52:16 +03:00
exit 1
2020-10-05 12:04:29 +03:00
fi
done