Skip to content

Commit

Permalink
Hotfix build script for homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleiade committed Mar 5, 2014
1 parent c5f45dd commit d793777
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@ SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"

# Get the trousseau package dir
TROUSSEAU_DIR="${DIR}/trousseau"

# Change into that directory
cd $DIR

# Get the git commit
GIT_COMMIT=$(git rev-parse HEAD)
GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)

# If we're building on Windows, specify an extension
EXTENSION=""
if [ "$(go env GOOS)" = "windows" ]; then
EXTENSION=".exe"
fi
# Get the version
VERSION=$(awk '/TROUSSEAU_VERSION/ { gsub("\"", ""); print $NF }' ${TROUSSEAU_DIR}/constants.go)

# Install dependencies
echo "--> Installing dependencies"
go get ./...

# Build!
echo "--> Building"
go build \
-ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" \
-v \
-o bin/trousseau${EXTENSION}
go build -ldflags "-X main.VERSION ${VERSION}" -v -o bin/trousseau
echo "bin/trousseau${EXTENSION} created"

# Copy binary to gopath
Expand Down

0 comments on commit d793777

Please sign in to comment.