Skip to content

Commit

Permalink
Update tfe-cli-installer.sh (#12)
Browse files Browse the repository at this point in the history
Fixes binary name.
  • Loading branch information
rgreinho authored Mar 25, 2020
1 parent 74443ac commit e2cd5fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extras/tfe-cli-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
set -euo pipefail

# Prepare variables.
REPO=rgreinho/tfe-cli
PROJECT=tfe-cli
REPO=rgreinho/${PROJECT}
LATEST_TAG=$(git ls-remote --tags --refs --sort="v:refname" git://github.com/${REPO}.git | tail -n1 | sed 's/.*\///')
VERSION=${VERSION:-$LATEST_TAG}
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
OPT_DIR="/usr/local/opt/${REPO}/${VERSION}"
BINARY="tfe-client-${VERSION}-${PLATFORM}-amd64"
BINARY="${PROJECT}-${VERSION}-${PLATFORM}-amd64"
export GITHUB_OAUTH_TOKEN=${GITHUB_TOKEN}

# Download the binaries.
Expand All @@ -19,7 +20,7 @@ fetch --repo="https://github.com/${REPO}" \

# Create the simlink
SRC="${OPT_DIR}/${BINARY}"
TARGET="/usr/local/bin/tfe-client"
TARGET="/usr/local/bin/${PROJECT}"
echo "Updating permissions..."
chmod +x "${SRC}"
echo "Linking ${SRC} to ${TARGET}..."
Expand Down

0 comments on commit e2cd5fd

Please sign in to comment.