2015-07-30 02:37:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-07-03 09:17:08 +00:00
|
|
|
set -e
|
2013-10-04 16:32:25 +00:00
|
|
|
|
2016-09-06 07:11:16 +00:00
|
|
|
if uname -s | grep -q "_NT-"; then
|
|
|
|
# Tell Cygwin / MSYS to really create symbolic links.
|
|
|
|
export CYGWIN="$CYGWIN winsymlinks:nativestrict"
|
|
|
|
export MSYS="$MSYS winsymlinks:nativestrict"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$GOPATH" ]; then
|
2015-07-03 09:19:13 +00:00
|
|
|
export GOPATH="$(pwd)"
|
2016-11-15 17:01:18 +00:00
|
|
|
mkdir -p src/github.com/git-lfs
|
|
|
|
[ -h src/github.com/git-lfs/git-lfs ] ||
|
|
|
|
ln -s "$GOPATH" src/github.com/git-lfs/git-lfs
|
2015-07-03 09:19:13 +00:00
|
|
|
fi
|
|
|
|
|
2016-12-14 21:52:34 +00:00
|
|
|
if uname -s | grep -q "_NT-"; then
|
|
|
|
echo "Installing goversioninfo to embed resources into Windows executables..."
|
|
|
|
go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
|
|
|
|
export PATH=$PATH:$GOPATH/bin/windows_386
|
|
|
|
echo "Creating the resource.syso version information file..."
|
|
|
|
go generate
|
|
|
|
fi
|
|
|
|
|
2014-04-16 21:11:52 +00:00
|
|
|
script/fmt
|
2015-07-03 09:17:40 +00:00
|
|
|
rm -rf bin/*
|
2016-05-23 21:03:25 +00:00
|
|
|
GO15VENDOREXPERIMENT=1 go run script/*.go -cmd build "$@"
|