diff --git a/.zsh/envs.zsh b/.zsh/envs.zsh index 2eaaf68..0ef5d33 100644 --- a/.zsh/envs.zsh +++ b/.zsh/envs.zsh @@ -119,7 +119,7 @@ odr_previous_dir='' odr-defaultenv() { [ "$PWD" = "${odr_previous_dir}" ] && return - export DETECTED_HOOKS= + DETECTED_HOOKS=() odr_previous_dir="$PWD" odr-load-python-venv odr-loadenvrc @@ -138,8 +138,7 @@ enable-hook() { } enable-detected-hooks() { - hooks=(${(s/ /)DETECTED_HOOKS}) - enable-hook $hooks + enable-hook "${DETECTED_HOOKS[@]}" } source_up() { diff --git a/.zsh/envs/python b/.zsh/envs/python index 9dcc01a..69c6572 100644 --- a/.zsh/envs/python +++ b/.zsh/envs/python @@ -5,9 +5,9 @@ # think this stuff is worth it, you can buy me a beer in return. odrling # ----------------------------------------------------------------------------- -# shellcheck shell=zsh +# shellcheck shell=bash -function () { +{ local possible_hooks=(ruff isort black pyright) local hooks=() @@ -16,6 +16,5 @@ function () { grep $hook pyproject.toml &>/dev/null && hooks+=($hook) done - export DETECTED_HOOKS="$hooks" - + DETECTED_HOOKS+="${hooks[@]}" }