Skip to content
Shell

feat: extend salmon color to all feature branch prefixes

Eddie Belaval36e97c70b8e1
diff --git a/statusline-command.sh b/statusline-command.sh
index 74f95ea..d2b024f 100755
--- a/statusline-command.sh
+++ b/statusline-command.sh
@@ -36,8 +36,8 @@ if git -C "$current_dir" rev-parse --git-dir > /dev/null 2>&1; then
fi
if [ -n "$branch" ]; then
- # Color feature branches in salmon
- if [[ "$branch" == feature/* ]]; then
+ # Color feature branches in salmon (feature/, fix/, hotfix/, bugfix/)
+ if [[ "$branch" == feature/* || "$branch" == fix/* || "$branch" == hotfix/* || "$branch" == bugfix/* ]]; then
git_info=" [git: \033[38;5;210m${branch}\033[2m${status}]"
else
git_info=" [git: ${branch}${status}]"
diff --git a/statusline.sh b/statusline.sh
index 0bbb443..182c00a 100755
--- a/statusline.sh
+++ b/statusline.sh
@@ -39,8 +39,8 @@ if git -C "$cwd" rev-parse --git-dir > /dev/null 2>&1; then
git_status=""
fi
- # Only color feature branches in salmon
- if [[ "$branch" == feature/* ]]; then
+ # Color feature branches in salmon (feature/, fix/, hotfix/, bugfix/)
+ if [[ "$branch" == feature/* || "$branch" == fix/* || "$branch" == hotfix/* || "$branch" == bugfix/* ]]; then
salmon=$(printf '\033[38;5;210m')
reset=$(printf '\033[0m')
git_info=" (${salmon}${branch}${git_status}${reset})"