From 95e227a8d00c2d6543ef374dc46e614f1e45d6ff Mon Sep 17 00:00:00 2001 From: John D Pell Date: Fri, 24 Sep 2021 00:05:09 -0700 Subject: [PATCH] theme/pete: `shellcheck` && `shfmt` --- clean_files.txt | 1 + themes/pete/pete.theme.bash | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index c737063769..b0291eec2c 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -133,6 +133,7 @@ themes/command_duration.theme.bash themes/easy themes/essential themes/modern +themes/pete themes/powerline themes/pure themes/purity diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash index d29553f82d..e55ad6ebc1 100644 --- a/themes/pete/pete.theme.bash +++ b/themes/pete/pete.theme.bash @@ -1,11 +1,16 @@ # shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. -prompt_setter() { - # Save history - _save-and-reload-history 1 - PS1="($(clock_prompt)) $(scm_char) [$blue\u$reset_color@$green\H$reset_color] $yellow\w${reset_color}$(scm_prompt_info)$(ruby_version_prompt) $reset_color " - PS2='> ' - PS4='+ ' +function prompt_setter() { + local clock_prompt scm_char scm_prompt_info ruby_version_prompt + clock_prompt="$(clock_prompt)" + scm_char="$(scm_char)" + scm_prompt_info="$(scm_prompt_info)" + ruby_version_prompt="$(ruby_version_prompt)" + _save-and-reload-history 1 # Save history + PS1="(${clock_prompt}) ${scm_char} [${blue?}\u${reset_color?}@${green?}\H${reset_color?}] ${yellow?}\w${reset_color?}${scm_prompt_info}${ruby_version_prompt} ${reset_color?} " + PS2='> ' + PS4='+ ' } safe_append_prompt_command prompt_setter