Skip to content

Commit

Permalink
Fixed issue meteor#6666 + Removed progress bar animation when no tty …
Browse files Browse the repository at this point in the history
…is present
  • Loading branch information
skaag committed Apr 5, 2016
1 parent 412736a commit 3abc5ab
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/admin/launch-meteor
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ if [ ! -x "$METEOR_WAREHOUSE_DIR/meteor" ]; then

# This returns something like:
# https://asdfasdfasdf.cloudfront.net/packages-bootstrap/1.2.3
ROOT_URL="$(curl -s --fail $BOOTSTRAP_URL)"
TARBALL_URL="${ROOT_URL}/meteor-bootstrap-${PLATFORM}.tar.gz"
TMP_ROOT_URL="$(curl -s --fail $BOOTSTRAP_URL)"
TARBALL_URL="${TMP_ROOT_URL}/meteor-bootstrap-${PLATFORM}.tar.gz"

INSTALL_TMPDIR="$(dirname "$METEOR_WAREHOUSE_DIR")/.meteor-install-tmp"
rm -rf "$INSTALL_TMPDIR"
Expand All @@ -81,7 +81,15 @@ if [ ! -x "$METEOR_WAREHOUSE_DIR/meteor" ]; then
echo "This is your first time using Meteor!" 1>&2
fi
echo "Installing a Meteor distribution in your home directory." 1>&2
curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR"

# Only show progress bar animations if we have a tty
# (Prevents tons of console junk when installing within a pipe)
if [[ -t 1 ]]; then
curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR"
else
curl -s --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR"
fi

# bomb out if it didn't work, eg no net
test -x "${INSTALL_TMPDIR}/.meteor/meteor"
mv "${INSTALL_TMPDIR}/.meteor" "$METEOR_WAREHOUSE_DIR"
Expand Down

0 comments on commit 3abc5ab

Please sign in to comment.