theme/candy: SC2154

Handle all unbound parameters, even colors!
pull/1980/head
John D Pell 2021-09-18 22:52:54 -07:00
parent 262e55eda2
commit c7c447a54b
1 changed files with 6 additions and 4 deletions

View File

@ -1,12 +1,14 @@
# shellcheck shell=bash # shellcheck shell=bash
# shellcheck disable=SC2034 # Expected behavior for themes. # shellcheck disable=SC2034 # Expected behavior for themes.
# shellcheck disable=SC2154 #TODO: fix these all.
function prompt_command() { function prompt_command() {
PS1="${green}\u@\h $(clock_prompt) ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue}${bold_blue} ${reset_color} ${normal}" local clock_prompt scm_prompt_info
clock_prompt="$(clock_prompt)"
scm_prompt_info="$(scm_prompt_info)"
PS1="${green?}\u@\h ${clock_prompt} ${reset_color?}${white?}\w${reset_color?}${scm_prompt_info}${blue?}${bold_blue?} ${reset_color?} ${normal?}"
} }
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"} : "${THEME_CLOCK_COLOR:=${blue?}}"
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"} : "${THEME_CLOCK_FORMAT:="%I:%M:%S"}"
safe_append_prompt_command prompt_command safe_append_prompt_command prompt_command