diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-01-03 21:01:52 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-01-03 21:01:52 +0100 |
| commit | 943643fd51110a6712d0c3e0bdbbd41a6c64a67a (patch) | |
| tree | 4e243ba6e708c66f86b9dbcd3f92ead66fa71055 /python/install.sh | |
| parent | cc8751fd7f338db173c2c04355460fd5cbcefb98 (diff) | |
.
Diffstat (limited to 'python/install.sh')
| -rwxr-xr-x | python/install.sh | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/python/install.sh b/python/install.sh index 3090eff..fe083b8 100755 --- a/python/install.sh +++ b/python/install.sh @@ -2,14 +2,38 @@ set -e +symlink () { + ln -sfT "$@" +} + PYTHON38=$(which python3.8) PYTHON39=$(which python3.9) PYTHON38_DIR=~/python38 PYTHON39_DIR=~/python39 +PIP38=$PYTHON38_DIR/bin/pip3.8 +PIP39=$PYTHON39_DIR/bin/pip3.9 + [ ! -d $PYTHON38_DIR ] && $PYTHON38 -m venv --system-site-packages $PYTHON38_DIR [ ! -d $PYTHON39_DIR ] && $PYTHON39 -m venv --system-site-packages $PYTHON39_DIR -$PYTHON38_DIR/bin/pip -q install -U -r ~/.dotfiles/python/requirements.pip38.txt -$PYTHON39_DIR/bin/pip -q install -U -r ~/.dotfiles/python/requirements.pip39.txt +$PIP38 -q install -U -r ~/.dotfiles/python/requirements.pip38.txt +$PIP39 -q install -U -r ~/.dotfiles/python/requirements.pip39.txt + +cat > ~/bin/python3.8 << EOF +#!/bin/sh +exec $(cd $PYTHON38_DIR; pwd)/bin/python3.8 "\$@" +EOF +cat > ~/bin/python3.9 << EOF +#!/bin/sh +exec $(cd $PYTHON39_DIR; pwd)/bin/python3.9 "\$@" +EOF +chmod +x ~/bin/python3.8 +chmod +x ~/bin/python3.9 + +symlink $PIP38 ~/bin/pip3.8 +symlink $PIP39 ~/bin/pip3.9 + +symlink $PYTHON38_DIR/bin/doit ~/bin/doit3.8 +symlink $PYTHON39_DIR/bin/doit ~/bin/doit3.9 |
