github.com/XiaoMi/Gaea@v1.2.5/genver.sh (about)

     1  #!/bin/bash
     2  
     3  version=`git log --date=iso --pretty=format:"%cd @%h" -1`
     4  if [ $? -ne 0 ]; then
     5      version="not a git repo"
     6  fi
     7  
     8  compile=`date +"%F %T %z"`" by "`go version`
     9  
    10  cat << EOF | gofmt > core/version.go
    11  package core
    12  
    13  const (
    14      // Version means gaea version
    15      Version = "$version"
    16      // Compile means gaea compole info
    17      Compile = "$compile"
    18  )
    19  EOF