Recovered lost code from other libraries
This commit is contained in:
31
bash/init_pyenv.sh
Normal file
31
bash/init_pyenv.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
init_pyenv(){
|
||||
vtuple="(${1//./, })";
|
||||
python3 -c "import sys; exit(sys.version_info <= ($vtuple))";
|
||||
pyvok=$?;
|
||||
|
||||
if [ $pyvok -eq 1 ]; then
|
||||
add-apt-repository -y ppa:deadsnakes/ppa
|
||||
apt-get update
|
||||
apt-get -y install "python$1" "python$1-venv"
|
||||
"python$1" -m venv .env
|
||||
else
|
||||
python3 -m venv .env
|
||||
fi;
|
||||
|
||||
source .env/bin/activate;
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
reqfile="requirements.txt";
|
||||
else
|
||||
reqfile="$2";
|
||||
fi
|
||||
|
||||
if [ -z "$3" ]; then
|
||||
piplog="/dev/null";
|
||||
else
|
||||
piplog="$3";
|
||||
fi
|
||||
|
||||
pip install -r "$reqfile" >> "$piplog";
|
||||
echo "PIP status: $?" >> "$piplog";
|
||||
}
|
||||
13
bash/thismux.sh
Normal file
13
bash/thismux.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
thismux() {
|
||||
dir="$(pwd)"
|
||||
# Search upwards for `.run/thismux.sock`
|
||||
while [ "$dir" != "/" ]; do
|
||||
if [ -d "$dir/.run" ]; then
|
||||
tmux -S "$dir/.run/thismux.sock" "$@"
|
||||
return
|
||||
fi
|
||||
dir="$(dirname "$dir")"
|
||||
done
|
||||
echo "No .run found in any parent directory."
|
||||
return 1
|
||||
}
|
||||
Reference in New Issue
Block a user