aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc.d/prompt.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 34c9ae87..2a21cb1d 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -147,9 +147,17 @@ prompt() {
fi
# Determine the repository URL and root directory
- local info=$(svn info 2>/dev/null)
- local url=$(awk -F': ' '$1 == "URL" {print $2}' <<<"$info")
- local root=$(awk -F': ' '$1 == "Repository Root" {print $2}' <<<"$info")
+ local url root
+ while IFS=: read key value; do
+ case $key in
+ 'URL')
+ url=${value## }
+ ;;
+ 'Repository Root')
+ root=${value## }
+ ;;
+ esac
+ done < <(svn info 2>/dev/null)
# Remove the root from the URL to get what's hopefully the branch
# name, removing leading slashes and the 'branches' prefix, and any