echo "TRAVIS_TAG: '$TRAVIS_TAG'" if [ "$TRAVIS_TAG" = "" ]; then echo "TRAVIS_TAG is not defined"; exit 1 fi L=1; while true do NPM="v$(npm show roderic version)"; if [ "$NPM" = "$TRAVIS_TAG" ]; then echo "$L: updated npm version is available: '$TRAVIS_TAG'" exit 0; else echo "$L: updated npm version is not available yet, npm: '$NPM', waiting in travis for: '$TRAVIS_TAG'" if [ "$L" = "20" ]; then echo "Can't wait any longer"; exit 1; fi L=$((L+1)) sleep 2 fi done