1 # Add a machine-hostname-based color flag to the prompt
6 flag_bin="%%LOCALBASE%%/bin/flag"
7 [ -x "${flag_bin}" ] || flag_bin="$(which flag 2>/dev/null)"
8 [ -x "${flag_bin}" ] || return
10 # Import flag, if wanted
11 [ -f "${HOME}/.noflag" ] || FLAG="($(${flag_bin} -e))"
13 # Patch flag into prompt, if not already there
14 [ "${FLAG}" ] && echo "${PS1}" | grep -q "${FLAG}" || PS1="${FLAG}${PS1}"
16 # Clean up environment