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.

32 lines
617 B

8 years ago
8 years ago
  1. #! /bin/bash
  2. set -euo pipefail
  3. IFS=$'\n\t'
  4. # script to update the given dependency in the glide.lock file with the checked out branch on the local host
  5. LIB=$1
  6. TMCORE=$GOPATH/src/github.com/tendermint/tendermint
  7. set +u
  8. if [[ "$GLIDE" == "" ]]; then
  9. GLIDE=$TMCORE/glide.lock
  10. fi
  11. set -u
  12. OLD_COMMIT=`bash $TMCORE/scripts/glide/parse.sh $LIB`
  13. PWD=`pwd`
  14. cd $GOPATH/src/github.com/tendermint/$LIB
  15. NEW_COMMIT=$(git rev-parse HEAD)
  16. cd $PWD
  17. uname -a | grep Linux > /dev/null
  18. if [[ "$?" == 0 ]]; then
  19. # linux
  20. sed -i "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
  21. else
  22. # mac
  23. sed -i "" "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
  24. fi