]> CyberLeo.Net >> Repos - CDN/bash-config.git/blob - bash-config/bash_profile.d/20-flag
Split 20-flag into profile part (exports FLAG if wanted) and rc part (inserts FLAG...
[CDN/bash-config.git] / bash-config / bash_profile.d / 20-flag
1 # Add a machine-hostname-based color flag to the environment
2
3 _i || return
4
5 # Find the flag binary
6 flag_bin="%%LOCALBASE%%/bin/flag"
7 [ -x "${flag_bin}" ] || flag_bin="$(which flag 2>/dev/null)"
8 [ -x "${flag_bin}" ] || return
9
10 # Import flag, if wanted
11 [ -f "${HOME}/.noflag" ] || FLAG="($(${flag_bin} -e))"
12
13 # Push FLAG into environment for subshells
14 [ "${FLAG}" ] && export FLAG
15
16 # Clean up environment
17 unset flag_bin