mirror of https://github.com/status-im/xgo.git
Inject Godeps before go get to avoid duplicate deps.
This commit is contained in:
parent
3ba5070af0
commit
c64946b88c
|
@ -29,13 +29,20 @@ if [ "$EXT_GOPATH" != "" ]; then
|
||||||
cd `go list -e -f {{.Dir}} $1`
|
cd `go list -e -f {{.Dir}} $1`
|
||||||
export GOPATH=$GOPATH:`pwd`/Godeps/_workspace
|
export GOPATH=$GOPATH:`pwd`/Godeps/_workspace
|
||||||
else
|
else
|
||||||
|
# Inject all possible Godep paths to short circuit go gets
|
||||||
|
GOPATH_ROOT=$GOPATH/src
|
||||||
|
IMPORT_PATH=$1
|
||||||
|
while [ "$IMPORT_PATH" != "." ]; do
|
||||||
|
export GOPATH=$GOPATH:$GOPATH_ROOT/$IMPORT_PATH/Godeps/_workspace
|
||||||
|
IMPORT_PATH=`dirname $IMPORT_PATH`
|
||||||
|
done
|
||||||
|
|
||||||
# Otherwise download the canonical import path (may fail, don't allow failures beyond)
|
# Otherwise download the canonical import path (may fail, don't allow failures beyond)
|
||||||
echo "Fetching main repository $1..."
|
echo "Fetching main repository $1..."
|
||||||
go get -d $1
|
go get -v -d $1
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd $GOPATH/src/$1
|
cd $GOPATH_ROOT/$1
|
||||||
export GOPATH=$GOPATH:`pwd`/Godeps/_workspace
|
|
||||||
|
|
||||||
# Switch over the code-base to another checkout if requested
|
# Switch over the code-base to another checkout if requested
|
||||||
if [ "$REPO_REMOTE" != "" ]; then
|
if [ "$REPO_REMOTE" != "" ]; then
|
||||||
|
|
Loading…
Reference in New Issue