@@ -21,15 +21,20 @@ python_initialized() {
2121
2222 python " ${LIB_DIR} /hyde/pyutils/pip_env.py" rebuild
2323}
24- python_env=" ${XDG_STATE_HOME:- $HOME / .local/ state} /hyde/pip_env/bin/activate"
25- if [[ -r " ${python_env} " ]]; then
26- # shellcheck disable=SC1090
27- source " ${python_env} "
28- else
29- printf " Warning: Python virtual environment not found at %s\n" " ${python_env} "
30- printf " You may need to run 'hyde-shell pyinit' to set it up.\n"
31- python_initialized
32- fi
24+
25+ python_activate () {
26+
27+ local python_env=" ${XDG_STATE_HOME:- $HOME / .local/ state} /hyde/pip_env/bin/activate"
28+ if [[ -r " ${python_env} " ]]; then
29+ # shellcheck disable=SC1090
30+ source " ${python_env} "
31+ else
32+ printf " Warning: Python virtual environment not found at %s\n" " ${python_env} "
33+ printf " You may need to run 'hyde-shell pyinit' to set it up.\n"
34+ python_initialized
35+ fi
36+
37+ }
3338
3439initialized () {
3540 cat << EOF
@@ -42,7 +47,7 @@ HYDE_SCRIPTS_PATH=${HYDE_SCRIPTS_PATH}
4247export BIN_DIR LIB_DIR SHARE_DIR PATH HYDE_SCRIPTS_PATH HYDE_SHELL_INIT
4348EOF
4449 # ? Use sed to remove any shebang hints to avoid conflicts with "eval"
45- command cat " ${LIB_DIR} /hyde/globalcontrol.sh"
50+ command cat " ${LIB_DIR} /hyde/globalcontrol.sh"
4651}
4752
4853# If args is init or --init, print initialization script
@@ -439,6 +444,7 @@ run_command() {
439444 exec bash " $dir /${1} .sh" " ${@: 2} "
440445 # Try .py extension
441446 elif [[ -f " $dir /${1} .py" ]]; then
447+ python_activate
442448 exec python " $dir /${1} .py" " ${@: 2} "
443449 # Try exact name (executable)
444450 elif [[ -f " $dir /${1} " && -x " $dir /${1} " ]]; then
0 commit comments