File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -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
@@ -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
You can’t perform that action at this time.
0 commit comments