Permalink
Browse files

g track is now colorized

  • Loading branch information...
1 parent f7e7656 commit 07c8ec5a054154ba8aee5e59c05b84e82126218e @orefalo committed Mar 3, 2013
Showing with 14 additions and 2 deletions.
  1. +5 −0 cmds/color.sh
  2. +7 −2 cmds/g2-track.sh
  3. +2 −0 g2-install.sh
View
5 cmds/color.sh 100644 → 100755
@@ -19,3 +19,8 @@ g2_initializeANSI()
}
g2_initializeANSI
+
+echo_fatal()
+{
+echo -e "${redf}$1${reset}";
+}
View
@@ -1,11 +1,16 @@
#!/bin/bash
#
+source "$G2_HOME/cmds/color.sh"
if [[ $# -eq 1 ]]; then
- [[ $1 != */* ]] && echo "fatal: $1 is not an upstream branch (ie. origin/xxx)." && exit 1
+ [[ $1 != */* ]] && echo_fatal "fatal: $1 is not an upstream branch (ie. origin/xxx)." && exit 1
"$GIT_EXE" branch --set-upstream-to $1
else
+ echo -e -n "${greenf}"
"$GIT_EXE" for-each-ref --format="local: %(refname:short) <--sync--> remote: %(upstream:short)" refs/heads
- echo "--Remotes------"
+ echo -e -n "${reset}"
+ echo -e "${boldon}--Remotes------------${boldoff}"
+ echo -e -n "${yellowf}"
"$GIT_EXE" remote -v
+ echo -e -n "${reset}"
fi
View
@@ -10,6 +10,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
OLDpwd=$PWD
cd $DIR
+export G2_HOME=$DIR
+
source ./cmds/color.sh
tips=(

0 comments on commit 07c8ec5

Please sign in to comment.