Skip to content

Commit

Permalink
Use a case statement rather than multiple ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Mar 18, 2024
1 parent c3fcf2b commit d5c5c15
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions bash_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@ posh_me() {

toggle_posh() {
detect_posh_settings
if [[ $posh_theme == "local" ]]; then
posh_theme="local-tiny"
elif [[ $posh_theme == "local-tiny" ]]; then
posh_theme="local"
elif [[ $posh_theme == "remote" ]]; then
posh_theme="remote-tiny"
elif [[ $posh_theme == "remote-tiny" ]]; then
posh_theme="remote"
else
posh_theme="remote"
fi
case $posh_theme in
"local") posh_theme="local-tiny" ;;
"local-tiny") posh_theme="local" ;;
"remote") posh_theme="remote-tiny" ;;
"remote-tiny"|"") posh_theme="remote" ;;
esac

FORCE_POSH_THEME=true
export FORCE_POSH_THEME
Expand Down

0 comments on commit d5c5c15

Please sign in to comment.