Created
October 14, 2015 00:01
-
-
Save ericbmerritt/ab2ac5cf9310da8584d8 to your computer and use it in GitHub Desktop.
Make opam behave correctly on a dumb terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Make sure opam never colorizes | |
# | |
opam () { | |
local direct_opam | |
if hash /usr/local/bin/opam 2> /dev/null; then | |
direct_opam=/usr/local/bin/opam | |
elif hash /usr/bin/opam 2> /dev/null; then | |
direct_opam=/usr/bin/opam | |
elif hash /bin/opam 2> /dev/null; then | |
direct_opam=/bin/opam | |
else | |
echo "Opam must be installed" | |
exit 1 | |
fi | |
local main_target="$1" | |
shift | |
$direct_opam $main_target --color=never $* | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment