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
|
2023-12-04 22:39:30 +01:00
|
|
|
ln -s $srcdir/runon.default.yaml $configdir/
|
2023-12-04 22:23:28 +01:00
|
|
|
else
|
2023-12-04 22:39:30 +01:00
|
|
|
cp -p $srcdir/runon.default.yaml $configdir/
|
2023-12-04 22:23:28 +01:00
|
|
|
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
|