summaryrefslogtreecommitdiff
path: root/set_gopath.sh
blob: f6dd03c0b8cd79b58526d85b148e7ff21926d162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

TOOLS_PKG='github.com/mongodb/mongo-tools'

setgopath() {
    SOURCE_GOPATH=`pwd`.gopath
    VENDOR_GOPATH=`pwd`/vendor

    # set up the $GOPATH to use the vendored dependencies as
    # well as the source for the mongo tools
    rm -rf .gopath/
    mkdir -p .gopath/src/"$(dirname "${TOOLS_PKG}")"
    ln -sf `pwd` .gopath/src/$TOOLS_PKG
    export GOPATH=`pwd`/.gopath:`pwd`/vendor
}

setgopath