#!/bin/bash -e

cd $(dirname $0)/..

if [ -f ./build/bootstrap.envs ];then
    . ./build/bootstrap.envs
fi

. ./scripts/common_functions

set_project_vars

if [ -L ${PACKAGE} ]; then
    rm ${PACKAGE}
fi

if [ ! -e ${PACKAGE} ]; then
    mkdir -p $(dirname $PACKAGE)
    ln -s $(pwd) $PACKAGE
fi

echo export GOPATH=$GOPATH

CGO_ENABLED=0 go build -o bin/${PROJECT}
