Gilles Grandou
97cf440ce5
* new uninstall script * system install no longer supported * local install using local virtualenv and symbolic links in ~/.local/bin * --dev switch to allow developper mode with symlinks to git
42 lines
892 B
Bash
Executable File
42 lines
892 B
Bash
Executable File
#!/bin/bash
|
|
|
|
srcdir=$(dirname $(readlink -f $0))
|
|
venvdir=~/.local/lib/runon
|
|
bindir=~/.local/bin
|
|
configdir=~/.config/runon
|
|
|
|
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
|
|
ln -s $srcdir/runon.default.conf $configdir/
|
|
else
|
|
cp -p $srcdir/runon.default.conf $configdir/
|
|
fi
|
|
|
|
echo "done."
|
|
|
|
if [[ ":$PATH:" != *":$(readlink -f $bindir):"* ]]; then
|
|
echo ""
|
|
echo "WARNING: $bindir is not in your PATH"
|
|
fi
|