Update install script
This commit is contained in:
+23
-7
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# install the heartbeat tools. By default, this will install the hbc
|
||||
# client only. The server is installed when the arg 'server' is passed
|
||||
# install the heartbeat client, hbc. The server is installed when the arg 'server' is passed
|
||||
# to the script. The script will install the heartbeat tools in a python
|
||||
# virtual environment in ~/venvs/hbd. The hbd and hbc commands will be
|
||||
# installed from the wheel and symlinked to ~/bin/hbd and ~/bin/hbc,
|
||||
@@ -13,13 +12,30 @@
|
||||
# hbd/hbc from wheel and create symlinks for hbd and hbc in ~/bin
|
||||
|
||||
set -e
|
||||
what=$1
|
||||
|
||||
for where in ~/.local/bin ~/bin; do
|
||||
if echo ":$PATH:" | grep -q ":$where:" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$what" = "server" ]; then
|
||||
echo "Installing heartbeat server (hbd)"
|
||||
else
|
||||
what="client"
|
||||
echo "Installing heartbeat client (hbc)"
|
||||
fi
|
||||
if [ ! -d ~/venvs/hbd ]; then
|
||||
mkdir -p ~/venvs
|
||||
python3 -m venv ~/venvs/hbd --system-site-packages
|
||||
fi
|
||||
. ~/venvs/hbd/bin/activate
|
||||
pip install 'git+ssh://git@git.wrede.ca/andreas/heartbeat.git'
|
||||
rm -f ~/bin/hbd
|
||||
rm -f ~/bin/hbc
|
||||
ln -sf $(which hbd) ~/bin/hbd
|
||||
ln -sf $(which hbc) ~/bin/hbc
|
||||
pip install --index-url https://git.wrede.ca/api/packages/andreas/pypi/simple/ --extra-index-url https://pypi.org/simple hbd[$what]
|
||||
if [ "$what" = "server" ]; then
|
||||
rm -f ~$where/hbd
|
||||
ln -sf $(which hbd) $where/hbd
|
||||
else
|
||||
rm -f $where/hbc
|
||||
ln -sf $(which hbc) $where/hbc
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user