From c9e6be90d85589be63d809d85868723ca87bc4a0 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Fri, 25 Feb 2022 19:50:48 +0100 Subject: [PATCH] Install git-prompt to LWS directory --- rc/git-prompt.sh | 7 +++++-- scripts/git-prompt-install.sh | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rc/git-prompt.sh b/rc/git-prompt.sh index 950d05a..39eacb3 100644 --- a/rc/git-prompt.sh +++ b/rc/git-prompt.sh @@ -1,4 +1,7 @@ -if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then +export GIT_PROMPT_PATH="$LWS/opt/bash-git-prompt" +GIT_PROMPT_INIT="$GIT_PROMPT_PATH/gitprompt.sh" + +if [ -f "$GIT_PROMPT_INIT" ]; then GIT_PROMPT_ONLY_IN_REPO=1 - source $HOME/.bash-git-prompt/gitprompt.sh + source "$GIT_PROMPT_INIT" fi diff --git a/scripts/git-prompt-install.sh b/scripts/git-prompt-install.sh index fd63964..ba43aa6 100755 --- a/scripts/git-prompt-install.sh +++ b/scripts/git-prompt-install.sh @@ -1,9 +1,8 @@ #!/bin/bash -# https://github.com/magicmonty/bash-git-prompt - set -x set -u -git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1 +readonly REPO="https://github.com/magicmonty/bash-git-prompt.git" +git clone "$REPO" "$GIT_PROMPT_PATH" --depth=1