From 6fd237c363fc4c90bc6b47bd3f783e7b2aafcb0b Mon Sep 17 00:00:00 2001 From: nmarghetti Date: Fri, 18 Dec 2020 01:09:17 +0100 Subject: [PATCH] tools/install,etc: Add quote around path variables to handle case with space in $HOME or $OSH --- lib/history.sh | 2 +- plugins/bashmarks/bashmarks.plugin.sh | 2 +- themes/brainy/brainy.theme.sh | 2 +- tools/install.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/history.sh b/lib/history.sh index 90a4c96..4d4074a 100644 --- a/lib/history.sh +++ b/lib/history.sh @@ -48,7 +48,7 @@ bind '"\e[C": forward-char' bind '"\e[D": backward-char' # Use standard ISO 8601 timestamp -# %F equivalent to %Y-%m-%d +# %F equivalent to %Y-%m-%d # %T equivalent to %H:%M:%S (24-hours format) # Show history diff --git a/plugins/bashmarks/bashmarks.plugin.sh b/plugins/bashmarks/bashmarks.plugin.sh index 3888512..38d9a05 100644 --- a/plugins/bashmarks/bashmarks.plugin.sh +++ b/plugins/bashmarks/bashmarks.plugin.sh @@ -37,7 +37,7 @@ if [ ! -n "$SDIRS" ]; then SDIRS=~/.sdirs fi -touch $SDIRS +touch "$SDIRS" # main function function bm { diff --git a/themes/brainy/brainy.theme.sh b/themes/brainy/brainy.theme.sh index 46ee97f..e476841 100644 --- a/themes/brainy/brainy.theme.sh +++ b/themes/brainy/brainy.theme.sh @@ -152,7 +152,7 @@ ___brainy_prompt_clock() { } ___brainy_prompt_battery() { - [ ! -e $OSH/plugins/battery/battery.plugin.sh ] || + [ ! -e "$OSH/plugins/battery/battery.plugin.sh" ] || [ "${THEME_SHOW_BATTERY}" != "true" ] && return info=$(battery_percentage) color=$_omb_prompt_bold_green diff --git a/tools/install.sh b/tools/install.sh index 76006a8..c117e48 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -137,7 +137,7 @@ _omb_install_user_bashrc() { printf "${BLUE}Using the Oh My Bash template file and adding it to ~/.bashrc${NORMAL}\n" _omb_install_run cp "$OSH"/templates/bashrc.osh-template ~/.bashrc sed "/^export OSH=/ c\\ -export OSH=$OSH +export OSH='${OSH//\'/\'\\\'\'}' " ~/.bashrc >| ~/.bashrc.omb-temp _omb_install_run mv -f ~/.bashrc.omb-temp ~/.bashrc