Add some quotes and double brackets...
--- a/README Wed May 08 15:18:39 2019 +0200
+++ b/README Mon Mar 02 13:16:10 2020 +0100
@@ -7,7 +7,7 @@
===
export ZDOTDIR=~/.zsh
-[ -f $ZDOTDIR/zshenv ] && . $ZDOTDIR/zshenv
+[[ -f "$ZDOTDIR/zshenv" ]] && . "$ZDOTDIR/zshenv"
===
Comments and suggestions are welcome!
--- a/zshrc.d/15-completion.zrc Wed May 08 15:18:39 2019 +0200
+++ b/zshrc.d/15-completion.zrc Mon Mar 02 13:16:10 2020 +0100
@@ -18,10 +18,10 @@
# Hosts completion
-if [ -f ~/.ssh/config ]; then
+if [[ -f ~/.ssh/config ]]; then
hosts=($hosts `grep ^Host ~/.ssh/config | sed s/Host\ // | egrep -v '^\*$'`)
fi
-if [ "$hosts" ]; then
+if [[ "$hosts" ]]; then
zstyle ':completion:*:hosts' hosts $hosts
fi
--- a/zshrc.d/20-prompt.zrc Wed May 08 15:18:39 2019 +0200
+++ b/zshrc.d/20-prompt.zrc Mon Mar 02 13:16:10 2020 +0100
@@ -73,7 +73,7 @@
r=$(__git_ps1)
# If GIT_PS1_SHOWUNTRACKEDFILES is used, we need to escape the %
r=${r//\%/%%}
- if [ ! -z $r ]; then echo -e "\n%Bgit%b$r"; fi
+ if [[ ! -z $r ]]; then echo -e "\n%Bgit%b$r"; fi
}
function __prompt_set_dev {
@@ -182,7 +182,7 @@
[%B%n%b:%l] %{$fg[red]%}%m%{$reset_color%}%# "
export PS1
- export _PROMPT_DEFINED="blackwhite"
+ export _PROMPT_DEFINED="color"
}
function prompt_set_dev {
--- a/zshrc.d/50-local.zrc Wed May 08 15:18:39 2019 +0200
+++ b/zshrc.d/50-local.zrc Mon Mar 02 13:16:10 2020 +0100
@@ -3,4 +3,4 @@
# Local customization #
#######################
-[ -f $ZDOTLOCALDIR/zshrc ] && . $ZDOTLOCALDIR/zshrc
+[[ -f "$ZDOTLOCALDIR/zshrc" ]] && . "$ZDOTLOCALDIR/zshrc"