From d57dcdae0cb174d7fb0f1c857b26dbd84044d464 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 30 Oct 2023 10:29:03 -0400 Subject: [PATCH] make better use of the guru shell tool --- configs/shells/bash/.bashrc | 11 ++--------- configs/shells/bash/macros.sh | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/configs/shells/bash/.bashrc b/configs/shells/bash/.bashrc index 1e99044..342546e 100644 --- a/configs/shells/bash/.bashrc +++ b/configs/shells/bash/.bashrc @@ -16,13 +16,6 @@ export PATH="$HOME/.local/bin:$PATH" export PS1="(${PS1_CTX:-bash}) \[\e[0;32m\]\u@\h \[\e[0;36m\]\w \[\e[0;36m\]\$ \[\e[0m\]" # If found, load studio python -if [ -d "/c/Programs/software/win/core/python/python_3.7.7" ]; then export PATH="/c/Programs/software/win/core/python/python_3.7.7:$PATH"; fi +# if [ -d "/c/Programs/software/win/core/python/python_3.7.7" ]; then export PATH="/c/Programs/software/win/core/python/python_3.7.7:$PATH"; fi + -# If `python --version` starts with `Python 3` -if [[ $(python --version) == Python\ 3* ]]; then - # If we don't have python3 in our path - if ! command -v python3 &> /dev/null; then - # Make an alias for python3 - alias python3=python - fi -fi diff --git a/configs/shells/bash/macros.sh b/configs/shells/bash/macros.sh index ef2603f..7e794ad 100644 --- a/configs/shells/bash/macros.sh +++ b/configs/shells/bash/macros.sh @@ -46,6 +46,16 @@ alias whois-ripe="whois -h whois.ripe.net" if [ -x "$(command -v nvim)" ]; then alias vim="nvim"; fi if [ -x "$(command -v neomutt)" ]; then alias mutt="neomutt"; fi +# Python aliases +# If `python --version` starts with `Python 3` +if [[ $(python --version) == Python\ 3* ]]; then + # If we don't have python3 in our path + if ! command -v python3 &> /dev/null; then + # Make an alias for python3 + alias python3=python + fi +fi + # Kill via pgrep nkill() { if [ $# != 1 ]; then @@ -195,8 +205,16 @@ ewconfig-pull-zip(){ # Pop a shell inside Guru env guru-shell() { - PYTHONPATH="//qs/resources/studio/studio2023/env:$PYTHONPATH" \ - PYTHONPATH="//qs/resources/studio/studio2023:$PYTHONPATH" \ + # Figure out the appropriate prefix + if [ $(uname -o | grep -c Msys) -gt 0 ]; then + s_drive="s://" + else + s_drive="//qs/resources" + fi + + PYTHONPATH="$s_drive/studio/studio2023/env:$PYTHONPATH" \ + PYTHONPATH="$s_drive/studio/studio2023:$PYTHONPATH" \ + PATH="/c/Programs/software/win/core/python/python_3.7.7:$PATH" \ PS1_CTX="guru bash" \ bash } \ No newline at end of file