From 27d0185cf1c4c1b7da8897f5447ff88d132efe5a Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Wed, 4 Jul 2018 23:55:45 +0300 Subject: [PATCH] fix quotes --- exports.zsh | 8 ++++---- functions.zsh | 6 +++--- zshrc | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/exports.zsh b/exports.zsh index c0a114c..47468a6 100644 --- a/exports.zsh +++ b/exports.zsh @@ -3,17 +3,17 @@ export LANG="en_US.UTF-8" export LC_ALL="$LANG" -if [[ -z $USER && -n $USERNAME ]]; then +if [[ -z "$USER" && -n "$USERNAME" ]]; then export USER="$USERNAME" fi -export DEFAULT_USER=dmitmel +export DEFAULT_USER="dmitmel" -if [[ -n $SSH_CONNECTION ]]; then +if [[ -n "$SSH_CONNECTION" ]]; then export EDITOR="rmate" else export EDITOR="code --wait" fi -export CLICOLOR=1 +export CLICOLOR="1" export SDKMAN_DIR="$HOME/.sdkman" diff --git a/functions.zsh b/functions.zsh index f05ecf7..6c1b257 100644 --- a/functions.zsh +++ b/functions.zsh @@ -1,11 +1,11 @@ #!/usr/bin/env zsh is_linux() { - [[ $OSTYPE == linux* ]] + [[ "$OSTYPE" == linux* ]] } is_macos() { - [[ $OSTYPE == darwin* ]] + [[ "$OSTYPE" == darwin* ]] } command_exists() { @@ -13,7 +13,7 @@ command_exists() { } source_if_exists() { - [[ -f $1 ]] && source "$1" + [[ -f "$1" ]] && source "$1" } run_before() { diff --git a/zshrc b/zshrc index e25ca43..790c80a 100755 --- a/zshrc +++ b/zshrc @@ -8,9 +8,8 @@ find_dotfiles_dir() { [[ -d "$DOTFILES_DIR" ]] && return done - local script_path - script_path=$(realpath "${(%):-%x}") - DOTFILES_DIR=$(dirname "$script_path") + local script_path="$(realpath "${(%):-%x}")" + DOTFILES_DIR="$(dirname "$script_path")" } find_dotfiles_dir