From e921dfa498cd240cbb4237b865813ab27b53ab4a Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 10 Feb 2016 22:20:45 -0500 Subject: [PATCH] Improve shell scripts --- misc/make-deps.sh | 7 ++++--- test/omv/helloworld.yaml | 1 + test/test-yamlfmt.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/make-deps.sh b/misc/make-deps.sh index a33b7740..0cd319b5 100755 --- a/misc/make-deps.sh +++ b/misc/make-deps.sh @@ -7,8 +7,8 @@ if env | grep -q '^TRAVIS=true$'; then fi if [ $travis -eq 0 ]; then - YUM=`which yum` - APT=`which apt-get` + YUM=`which yum 2>/dev/null` + APT=`which apt-get 2>/dev/null` if [ -z "$YUM" -a -z "$APT" ]; then echo "The package managers can't be found." exit 1 @@ -34,5 +34,6 @@ cd - rm -rf etcd # clean up to avoid failing on upstream gofmt errors go get ./... # get all the go dependencies -go get golang.org/x/tools/cmd/vet # add in `go vet` for travis +[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X +go get golang.org/x/tools/cmd/vet # add in `go vet` for travis go get golang.org/x/tools/cmd/stringer # for automatic stringer-ing diff --git a/test/omv/helloworld.yaml b/test/omv/helloworld.yaml index c6d781a6..6d2771d9 100644 --- a/test/omv/helloworld.yaml +++ b/test/omv/helloworld.yaml @@ -30,6 +30,7 @@ - :name: etcd :shell: - iptables -F + - cd /vagrant/mgmt/ && make path - cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/ - etcd -bind-addr "`hostname --ip-address`:2379" & - cd && mgmt --help diff --git a/test/test-yamlfmt.sh b/test/test-yamlfmt.sh index 3001c3e9..d97bc33d 100755 --- a/test/test-yamlfmt.sh +++ b/test/test-yamlfmt.sh @@ -12,7 +12,7 @@ fi ROOT=$(dirname "${BASH_SOURCE}")/.. -RUBY=`which ruby` +RUBY=`which ruby 2>/dev/null` if [ -z $RUBY ]; then echo "The 'ruby' utility can't be found." exit 1