runon/install

42 lines
892 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
2021-04-30 20:03:24 +02:00
srcdir=$(dirname $(readlink -f $0))
venvdir=~/.local/lib/runon
bindir=~/.local/bin
configdir=~/.config/runon
2021-04-30 20:03:24 +02:00
if [ "$1" == "--dev" ]; then
editable=--editable
devmode=1
fi
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/
else
2023-12-04 22:39:30 +01:00
cp -p $srcdir/runon.default.yaml $configdir/
fi
2021-04-30 20:03:24 +02:00
echo "done."
if [[ ":$PATH:" != *":$(readlink -f $bindir):"* ]]; then
echo ""
echo "WARNING: $bindir is not in your PATH"
2021-04-30 20:03:24 +02:00
fi