2023-12-04 22:23:28 +01:00
|
|
|
#!/bin/bash
|
2021-04-30 20:03:24 +02:00
|
|
|
|
2023-12-04 22:23:28 +01:00
|
|
|
srcdir=$(dirname $(readlink -f $0))
|
|
|
|
venvdir=~/.local/lib/runon
|
|
|
|
bindir=~/.local/bin
|
|
|
|
configdir=~/.config/runon
|
2021-04-30 20:03:24 +02:00
|
|
|
|
2023-12-04 22:23:28 +01:00
|
|
|
if [ "$1" == "--dev" ]; then
|
|
|
|
editable=--editable
|
|
|
|
devmode=1
|
2021-05-01 16:23:56 +02:00
|
|
|
fi
|
|
|
|
|
2023-12-04 22:23:28 +01:00
|
|
|
if [ ! -d $venvdir/bin/activate ]; then
|
|
|
|
echo "create virtualenv $venvdir..."
|
|
|
|
python3 -m venv $venvdir
|
|
|
|
fi
|
|
|
|
source $venvdir/bin/activate
|
|
|
|
|
|
|
|
echo "populate $venvdir..."
|
|
|
|
python3 -m pip install --upgrade pip
|
|
|
|
python3 -m pip install wheel
|
|
|
|
python3 -m pip install $editable $srcdir
|
|
|
|
|
|
|
|
echo "create links in $bindir..."
|
|
|
|
mkdir -p $bindir
|
|
|
|
ln -sf $venvdir/bin/runon $bindir/
|
|
|
|
|
|
|
|
echo "install base config in $configdir..."
|
|
|
|
mkdir -p $configdir
|
|
|
|
if [ -n "$devmode" ]; then
|
|
|
|
ln -s $srcdir/runon.default.conf $configdir/
|
|
|
|
else
|
|
|
|
cp -p $srcdir/runon.default.conf $configdir/
|
|
|
|
fi
|
2021-04-30 20:03:24 +02:00
|
|
|
|
2023-12-04 22:23:28 +01:00
|
|
|
echo "done."
|
2021-05-01 16:28:24 +02:00
|
|
|
|
2023-12-04 22:23:28 +01:00
|
|
|
if [[ ":$PATH:" != *":$(readlink -f $bindir):"* ]]; then
|
|
|
|
echo ""
|
|
|
|
echo "WARNING: $bindir is not in your PATH"
|
2021-04-30 20:03:24 +02:00
|
|
|
fi
|