shell-scripts: Use [[ instead of [ where possible
Replace all occurrences of [ with [[ in bash and zsh scripts and configs. Performance wise it makes sense to use the builtin instead of calling an external command also when from a functionality stand point `test` would suffice.
This commit is contained in:
@@ -52,7 +52,7 @@ local -a fzf_args=(
|
||||
# Execute git show on the commit as preview.
|
||||
"--preview" "
|
||||
out=\"\$(echo {} | sed -Ee \"$del_ansi\" -e \"$commit_hash\")\"
|
||||
if [ \"\$out\" ]; then
|
||||
if [[ \"\$out\" ]]; then
|
||||
git show \"${(j:%n:)format}\" \"$date\" $colors \"\$out\" \
|
||||
| diff-so-fancy
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user