From bf066785e40aeb25483cf8aade99b64f1ebe6e1d Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 7 Mar 2010 17:12:54 -0600 Subject: [PATCH] Stub bash include for prompt flag --- bash_prompt.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bash_prompt.sh diff --git a/bash_prompt.sh b/bash_prompt.sh new file mode 100644 index 0000000..37e57cc --- /dev/null +++ b/bash_prompt.sh @@ -0,0 +1,7 @@ +# Find executable +flag_bin="%%LOCALBASE%%/bin/flag" +[ ! -x "${flag_bin}" ] && flag_bin="$(which flag 2>/dev/null)" +# Import flag if can and wanted +[ "${flag_bin}" -a ! -f "${HOME}/.noflag" ] && export FLAG="($(${flag_bin} -e))" +# Patch flag into prompt, if not already there +[ "${FLAG}" ] && echo "${PS1}" | grep -q "${FLAG}" || export PS1="${FLAG}${PS1}" -- 2.42.0