Skip to content

Commit

Permalink
fix the version check (#3753)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks committed Sep 3, 2020
1 parent a733b39 commit 84342d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/install.sh
Expand Up @@ -51,22 +51,22 @@ function install_tilt() {
}

function version_check() {
VERSION="0.17.4"
VERSION_FROM_BIN="$(tilt version 2>&1 || true)"
RUBY_TILT_PATTERN="template engine not found"
TILT_DEV_PATTERN='^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?, built [0-9]+-[0-9]+-[0-9]+$'
if [[ $VERSION =~ $RUBY_TILT_PATTERN ]]; then
if [[ $VERSION_FROM_BIN =~ $RUBY_TILT_PATTERN ]]; then
echo "Tilt installed!"
echo
echo "Note: the ruby templating program named 'tilt' (at $(command -v tilt)) appears before tilt.dev's tilt in your \$PATH."
echo "You'll need to adjust your \$PATH, uninstall the other tilt, rename tilt, or use an absolute path to run tilt.dev's tilt. See https://docs.tilt.dev/faq.html."
exit 1
elif ! [[ $VERSION =~ $TILT_DEV_PATTERN ]]; then
elif ! [[ $VERSION_FROM_BIN =~ $TILT_DEV_PATTERN ]]; then
echo "Tilt installed!"
echo
echo "Note: it looks like it is not the first program named 'tilt' in your path. \`tilt version\` (running from $(command -v tilt)) did not return a tilt.dev version string."
echo "It output this instead:"
echo
echo "$VERSION"
echo "$VERSION_FROM_BIN"
echo
echo "Perhaps you have a different program named tilt in your \$PATH?"
exit 1
Expand Down

0 comments on commit 84342d1

Please sign in to comment.