Skip to content

Commit

Permalink
theme/norbu: shellcheck && shfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelicWizard committed Jan 8, 2022
1 parent ae911a1 commit 91ae581
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ themes/command_duration.theme.bash
themes/easy
themes/essential
themes/modern
themes/norbu
themes/pete
themes/powerline
themes/pure
Expand Down
30 changes: 16 additions & 14 deletions themes/norbu/norbu.theme.bash
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#!/usr/bin/env bash
# shellcheck shell=bash
# shellcheck disable=SC2034 # Expected behavior for themes.

function set_prompt_symbol () {
if test $1 -eq 0 ; then
PROMPT_SYMBOL=">_"
else
PROMPT_SYMBOL="${orange}>_${normal}"
fi
function set_prompt_symbol() {
if [[ $1 -eq 0 ]]; then
prompt_symbol=">_"
else
prompt_symbol="${orange?}>_${normal?}"
fi
}

function prompt_command() {
set_prompt_symbol $?
if test -z "$VIRTUAL_ENV" ; then
PYTHON_VIRTUALENV=""
else
PYTHON_VIRTUALENV="${bold_yellow}[`basename \"$VIRTUAL_ENV\"`]"
fi
local ret_val="$?" prompt_symbol scm_prompt_info
if [[ -n "${VIRTUAL_ENV:-}" ]]; then
PYTHON_VIRTUALENV="${bold_yellow?}[${VIRTUAL_ENV##*/}]"
fi

PS1="${bold_orange}${PYTHON_VIRTUALENV}${reset_color}${bold_green}[\w]${bold_blue}\[$(scm_prompt_info)\]${normal} \n${PROMPT_SYMBOL} "
scm_prompt_info="$(scm_prompt_info)"
set_prompt_symbol "${ret_val}"
PS1="${bold_orange?}${PYTHON_VIRTUALENV:-}${reset_color?}${bold_green?}[\w]${bold_blue?}[${scm_prompt_info}]${normal?} \n${prompt_symbol} "
}

# scm themeing
Expand Down

0 comments on commit 91ae581

Please sign in to comment.