Skip to content

Commit

Permalink
Discover asset url (#24)
Browse files Browse the repository at this point in the history
* Discover tar.gz asset URL

See #23

* Build fails on error

See #23
  • Loading branch information
matiasgarciaisaia authored and bcardiff committed Aug 8, 2017
1 parent 8f70f63 commit 1228ba3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

steptxt="----->"

Expand Down Expand Up @@ -47,13 +47,13 @@ else
CRYSTAL_VERSION_REASON='due to latest release at https://github.com/crystal-lang/crystal'
fi

CRYSTAL_URL="https://github.com/crystal-lang/crystal/releases/download/$CRYSTAL_VERSION/crystal-$CRYSTAL_VERSION-1-linux-x86_64.tar.gz"
CRYSTAL_URL=`${CURL} https://api.github.com/repos/crystal-lang/crystal/releases/tags/${CRYSTAL_VERSION} | grep 'https://github.com/crystal-lang/crystal/releases/download/.*-linux-x86_64.tar.gz' | sed 's/.*: "\(.*\)"/\1/'`
CRYSTAL_DIR=/tmp/crystal
unset GIT_DIR

# Install Crystal
mkdir -p $CRYSTAL_DIR
start "Installing Crystal ($CRYSTAL_VERSION $CRYSTAL_VERSION_REASON)"
start "Installing Crystal ($CRYSTAL_VERSION $CRYSTAL_VERSION_REASON) from $CRYSTAL_URL"
${CURL} $CRYSTAL_URL | tar xz -C $CRYSTAL_DIR --strip-component=1
finished
PATH="${PATH}:${CRYSTAL_DIR}/bin"
Expand Down

0 comments on commit 1228ba3

Please sign in to comment.