1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00
electrs/contrib/venv_wrapper.sh

19 lines
340 B
Bash
Raw Normal View History

2021-10-15 08:56:53 +02:00
#!/bin/bash
set -e
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
cmd="$(basename -- "${BASH_SOURCE[0]}" .sh)".py
if [ "$1" = "--venv" ]; then
shift
if [ ! -d .venv ]; then
python -m venv .venv
2021-10-15 08:56:53 +02:00
.venv/bin/pip install pycoin logbook prettytable base58
fi
PATH=$PWD/.venv/bin:$PATH
fi
exec python "$cmd" "$@"