From 0ac3d048bef2e9c3f3e1c616d247d2b29a6b3f10 Mon Sep 17 00:00:00 2001 From: Thomas Rebele Date: Fri, 1 Apr 2016 14:42:42 +0200 Subject: [PATCH] added option to specify path of template file --- README.md | 3 ++- gitprompt.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c05c53d..0ec3cd1 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,8 @@ Add to the `~/.bashrc`: # GIT_PROMPT_END=... # uncomment for custom prompt end sequence # as last entry source the gitprompt script - # GIT_PROMPT_THEME=Custom # use custom .git-prompt-colors.sh + # GIT_PROMPT_THEME=Custom # use custom theme specified in file GIT_PROMPT_THEME_FILE (default ~/.git-prompt-colors.sh) + # GIT_PROMPT_THEME_FILE=~/.git-prompt-colors.sh # GIT_PROMPT_THEME=Solarized # use theme optimized for solarized color scheme source ~/.bash-git-prompt/gitprompt.sh ``` diff --git a/gitprompt.sh b/gitprompt.sh index d679acd..70b11b6 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -26,6 +26,9 @@ function echoc() { function get_theme() { local CUSTOM_THEME_FILE="${HOME}/.git-prompt-colors.sh" + if [[ ! (-z ${GIT_PROMPT_THEME_FILE} ) ]]; then + CUSTOM_THEME_FILE=$GIT_PROMPT_THEME_FILE + fi local DEFAULT_THEME_FILE="${__GIT_PROMPT_DIR}/themes/Default.bgptheme" if [[ -z ${GIT_PROMPT_THEME} ]]; then