Allow running multiple PROMPT_COMMAND snippets.
[profile.git] / .profile.d / git-commit-tree.bashrc
index 37ec8eb..95a4eaf 100644 (file)
@@ -1,11 +1,11 @@
 # Set GIT_AUTHOR_NAME etc from dotfiles in the profile.
 function git_commit_tree() {
   local WHO=$1; shift
-  local who=${WHO,,}
+  local who="$(echo $WHO | tr '[[:upper:]]' '[[:lower:]]')"
   local WHAT=
 
   for WHAT in EMAIL NAME; do
-    local what=${WHAT,,}
+    local what="$(echo $WHAT | tr '[[:upper:]]' '[[:lower:]]')"
     local where=
 
     # Look in $HOME then $PROFILE_HOME.
@@ -20,7 +20,7 @@ function git_commit_tree() {
 
         # Fall back to generic file.
         if [ -z "$value" ]; then
-            eval value=\$\(\<\$${where}/".git_${what}"\) 2>/dev/null
+            eval value=\$\(\<${where}/".git_${what}"\) 2>/dev/null
         fi
       fi