Skip to content

Commit

Permalink
Cygwin-friendly check/cross marks
Browse files Browse the repository at this point in the history
  • Loading branch information
tdd committed May 22, 2015
1 parent 34ccff1 commit d91e9e7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions git-stree
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ GREEN=32
RED=31
YELLOW=33

# Symbols
if [ "cygwin" = "$TERM" ]; then
CHECK=""
CROSS="X"
else
CHECK=""
CROSS=""
fi

# Grabbing CLI arguments and the main subcommand
args=("$@")
subcmd=${args[0]}
Expand Down Expand Up @@ -222,7 +231,7 @@ function error
{
show_usage=$1
shift
message $RED '✖︎ '"$@"$'\n' >&2
message $RED "$CROSS ""$@"$'\n' >&2
$show_usage && usage
kill -s ABRT $$
}
Expand Down Expand Up @@ -654,7 +663,7 @@ EOT

# Helper: success message. This will show up in green on STDOUT.
function yay {
message $GREEN '✔︎ '"$@"$'\n'
message $GREEN "$CHECK ""$@"$'\n'
}

# Allow subshells (such as functions called within a `$(…)` subshell)
Expand Down

0 comments on commit d91e9e7

Please sign in to comment.