You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
557 B

  1. #! /bin/bash
  2. set -u
  3. function parseGlide() {
  4. cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
  5. }
  6. # fetch and checkout vendored dep
  7. glide=$1
  8. lib=$2
  9. echo "----------------------------------"
  10. echo "Getting $lib ..."
  11. go get -t github.com/tendermint/$lib/...
  12. VENDORED=$(parseGlide $glide $lib)
  13. cd $GOPATH/src/github.com/tendermint/$lib
  14. MASTER=$(git rev-parse origin/master)
  15. if [[ "$VENDORED" != "$MASTER" ]]; then
  16. echo "... VENDORED != MASTER ($VENDORED != $MASTER)"
  17. echo "... Checking out commit $VENDORED"
  18. git checkout $VENDORED &> /dev/null
  19. fi