-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build script since my editor hates multiple files in the main pac…
…kage
- Loading branch information
hashworks
committed
Jan 19, 2016
1 parent
e9ae17f
commit 6a59acc
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$xREL_TERMINAL_CLIENT_CONSUMER_KEY" == "" ] || [ "$xREL_TERMINAL_CLIENT_CONSUMER_SECRET" == "" ]; then | ||
echo You need to set the following env variables: xREL_TERMINAL_CLIENT_CONSUMER_KEY and xREL_TERMINAL_CLIENT_CONSUMER_SECRET. >&2 | ||
echo Get those from http://www.xrel.to/api-apps.html >&2 | ||
exit 1 | ||
fi | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
cd "$DIR" | ||
commit="$(git rev-parse --short HEAD 2>/dev/null)" | ||
|
||
if [ "$commit" != "" ]; then | ||
version=dev-"$commit" | ||
fi | ||
|
||
rm -Rf ./bin/ | ||
mkdir ./bin/ | ||
|
||
go build -ldflags '-X main.VERSION='"$version"' | ||
-X main.OAUTH_CONSUMER_KEY='"$xREL_TERMINAL_CLIENT_CONSUMER_KEY"' | ||
-X main.OAUTH_CONSUMER_SECRET='"$xREL_TERMINAL_CLIENT_CONSUMER_SECRET" \ | ||
-o "./bin/xREL" "$DIR"/src/*.go |