1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-26 10:13:37 +08:00

colorize: add compatibility for zsh < 5.1 (#9400)

The direct assignment of a local array is not possible in older ZSH version, as used by RHEL/CentOS 7.
This commit is contained in:
spreiter 2020-10-29 11:54:29 +01:00 committed by GitHub
parent 63922b5ec4
commit 47d30784c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,8 @@ alias cless="colorize_less"
ZSH_COLORIZE_PLUGIN_PATH=$0:A ZSH_COLORIZE_PLUGIN_PATH=$0:A
colorize_check_requirements() { colorize_check_requirements() {
local available_tools=("chroma" "pygmentize") local -a available_tools
available_tools=("chroma" "pygmentize")
if [ -z "$ZSH_COLORIZE_TOOL" ]; then if [ -z "$ZSH_COLORIZE_TOOL" ]; then
if (( $+commands[pygmentize] )); then if (( $+commands[pygmentize] )); then