minio/buildscripts/git-commit-id.sh

19 lines
328 B
Bash
Raw Normal View History

2015-03-26 01:51:19 -04:00
#!/usr/bin/env bash
CONST_FILE=build-constants.go
cat > $CONST_FILE <<EOF
/*
* ** DO NOT EDIT THIS FILE. THIS FILE IS AUTO GENERATED BY RUNNING MAKE **
*/
package main
const (
2015-04-02 15:48:22 -04:00
minioGitCommitHash = "__GIT_COMMIT_HASH__"
2015-03-26 01:51:19 -04:00
)
EOF
commit_id=$(git log --format="%H" -n 1)
sed -i "s/__GIT_COMMIT_HASH__/$commit_id/" $CONST_FILE