_functions 488 B

12345678910111213141516171819202122
  1. RED='\033[0;31m'
  2. GREEN='\033[0;32m'
  3. BLUE='\033[0;34m'
  4. CYAN='\033[0;36m'
  5. RESET='\033[0m'
  6. # Colored messages (blue is the default)
  7. # Examples:
  8. # m "hello world"
  9. # m "hello world" "$GREEN"
  10. function m () {
  11. local COLOR=${2:-$BLUE}
  12. echo -e "$COLOR$1$RESET"
  13. }
  14. function git_version () {
  15. VERSION=$(git -C "$ROOT" describe --tags --always)
  16. REVISION=$(git -C "$ROOT" rev-parse HEAD)
  17. TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S %Z")
  18. GO_VERSION=$(go version | { read _ _ v _; echo ${v#go}; })
  19. }