move things slightly and make version and gitSha constants.

pull/17/head
John Shahid 2013-10-31 11:53:04 -04:00
parent d7e75135a7
commit e283914d80
2 changed files with 9 additions and 7 deletions

View File

@ -95,7 +95,7 @@ function build_packages {
function setup_version {
echo "Changing version from dev to $influxdb_version"
sha1=`git rev-list --max-count=1 HEAD`
sed -i.bak -e "s/var version = \"dev\"/var version = \"$influxdb_version\"/" -e "s/var gitSha = \"\"/var gitSha = \"$sha1\"/" src/server/server.go
sed -i.bak -e "s/version = \"dev\"/version = \"$influxdb_version\"/" -e "s/gitSha = \"\"/gitSha = \"$sha1\"/" src/server/server.go
sed -i.bak -e "s/REPLACE_VERSION/$influxdb_version/" scripts/post_install.sh
}

View File

@ -16,14 +16,16 @@ import (
"strconv"
)
var fileName = flag.String("config", "config.json.sample", "Config file")
var wantsVersion = flag.Bool("version", false, "Get version number")
var pidFile = flag.String("pidfile", "", "the pid file")
var version = "dev"
var gitSha = ""
const (
version = "dev"
gitSha = ""
)
func main() {
fileName := flag.String("config", "config.json.sample", "Config file")
wantsVersion := flag.Bool("version", false, "Get version number")
pidFile := flag.String("pidfile", "", "the pid file")
runtime.GOMAXPROCS(runtime.NumCPU())
flag.Parse()