]> arthur.barton.de Git - ax-zsh.git/commitdiff
Refactoring: Always use "[[" (instead of "[")
authorAlexander Barton <alex@barton.de>
Wed, 15 Dec 2021 10:31:12 +0000 (11:31 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 15 Dec 2021 10:31:15 +0000 (11:31 +0100)
No functional changes.

core/40_path/40_path.zprofile
plugins/browser_select/browser_select.zprofile
plugins/editor_select/editor_select.zprofile
plugins/iterm2/iterm2.zshrc

index 0ee2a17966528e89a95338c156f10c7cefdc6300..03490293ad85492718fe7c64ee0b6ba231da8e2e 100644 (file)
@@ -30,7 +30,7 @@ for d (
        ~/sbin
        ~/Applications
 ); do
-       [ -d "$d" ] && path=("$d" $path)
+       [[ -d "$d" ]] && path=("$d" $path)
 done
 
 # Append additional search paths
@@ -39,7 +39,7 @@ for d (
        /usr/local/games
        /usr/games
 ); do
-       [ -d "$d" ] && path=($path "$d")
+       [[ -d "$d" ]] && path=($path "$d")
 done
 
 # Set default MANPATH
@@ -55,7 +55,7 @@ if [[ $? -ne 0 ]]; then
                /usr/share/man
                /usr/local/share/man
        ); do
-               [ -d "$d" ] && manpath=($manpath "$d")
+               [[ -d "$d" ]] && manpath=($manpath "$d")
        done
 fi
 typeset -Ux MANPATH
index 0f72e74aca35616256616e46eb3e473def3a6b7b..bdda2782e504f123374c1baf40da1fcf41a587ec 100644 (file)
@@ -18,7 +18,7 @@ if [[ -z "$BROWSER" ]]; then
                $x11_browsers
                elinks w3m links2 links lynx
        ); do
-               if [ -n "$commands[$browser]" ]; then
+               if [[ -n "$commands[$browser]" ]]; then
                        BROWSER="$commands[$browser]"
                        break
                fi
index 3aecb6ff01e64efbb84bd18ba8cb67a6cb8dc7cd..1fdc1c9fc59fbebdd83f70a046533bec7bfbf798 100644 (file)
@@ -12,7 +12,7 @@ if [[ -z "$EDITOR" ]]; then
                $x11_editors
                vim nano joe vi
        ); do
-               if [ -n "$commands[$editor]" ]; then
+               if [[ -n "$commands[$editor]" ]]; then
                        EDITOR="$commands[$editor]"
                        break
                fi
index 0886e499ab61a641a32bc77f005b135a68016bab..211e617a0372be5ea0ff059b3c87cfd8f1fafee5 100644 (file)
@@ -137,14 +137,14 @@ iterm2_decorate_prompt() {
 
 iterm2_precmd() {
        local STATUS="$?"
-       if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
+       if [[ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]]; then
                # You pressed ^C while entering a command (iterm2_preexec did not run)
                iterm2_before_cmd_executes
        fi
 
        iterm2_after_cmd_executes "$STATUS"
 
-       if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then
+       if [[ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]]; then
                iterm2_decorate_prompt
        fi
 }