Skip to content

Commit

Permalink
fix zsh compatibility (fixes #896)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas2511 committed Jan 16, 2023
1 parent 67b111a commit e3ef43c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dehydrated
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jsonsh() {

# Force zsh to expand $A into multiple words
local is_wordsplit_disabled
is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$')"
is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$' || true)"
if [ "${is_wordsplit_disabled}" != "0" ]; then setopt shwordsplit; fi
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | grep -Ev "^$SPACE$"
if [ "${is_wordsplit_disabled}" != "0" ]; then unsetopt shwordsplit; fi
Expand Down

0 comments on commit e3ef43c

Please sign in to comment.