]> CyberLeo.Net >> Repos - CDN/flag.git/blob - bash_prompt.sh
Look for flag in site-local too, for FreeBSD
[CDN/flag.git] / bash_prompt.sh
1 # Find executable
2 flag_bin="%%LOCALBASE%%/bin/flag"
3 [ ! -x "${flag_bin}" ] && flag_bin="$(which flag 2>/dev/null)"
4 # Import flag if can and wanted
5 [ "${flag_bin}" -a ! -f "${HOME}/.noflag" ] && export FLAG="($(${flag_bin} -e))"
6 # Patch flag into prompt, if not already there
7 [ "${FLAG}" ] && echo "${PS1}" | grep -q "${FLAG}" || export PS1="${FLAG}${PS1}"