[zsh] Fix path_lines

This commit is contained in:
Ivan Malison 2023-08-19 22:59:35 -06:00
parent 4c6625ce50
commit 2ea2071dd5

View File

@ -1,8 +1,10 @@
#!/usr/bin/env sh
#!/usr/bin/env zsh
function path_lines {
var="${1:-PATH}"
split_by_char ":" "${!var}"
local var="${1:-PATH}"
# This is a workaround to achieve variable indirection for both Bash and Zsh
eval "local value=\$$var"
split_by_char ":" "$value"
}
path_lines "$@"