Skip to content

Commit

Permalink
Fix installer (#19)
Browse files Browse the repository at this point in the history
Removes unnecessary use of `GITHUB_TOKEN` and uses `curl` instead `
fetch`.

Fixes #16
  • Loading branch information
rgreinho committed Mar 30, 2020
1 parent 9d94ef2 commit 27c8c1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix problem preventing to create a workspace. [#18]
* Fix problem preventing to create a new workspace. [#18]
* Fix the installer. [#19]

## [1.0.0] - 2020-03-25

Expand All @@ -30,3 +31,4 @@ Initial version with support for managing:
[#14]: https://github.com/rgreinho/tfe-cli/pull/14
[#15]: https://github.com/rgreinho/tfe-cli/pull/15
[#18]: https://github.com/rgreinho/tfe-cli/pull/18
[#19]: https://github.com/rgreinho/tfe-cli/pull/19
12 changes: 6 additions & 6 deletions extras/tfe-cli-installer.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ LATEST_TAG=$(git ls-remote --tags --refs --sort="v:refname" git://github.com/${R
VERSION=${VERSION:-$LATEST_TAG}
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
OPT_DIR="/usr/local/opt/${REPO}/${VERSION}"
BINARY="${PROJECT}-${VERSION}-${PLATFORM}-amd64"
export GITHUB_OAUTH_TOKEN=${GITHUB_TOKEN}
ARCH=amd64
BINARY="${PROJECT}-${VERSION}-${PLATFORM}-${ARCH}"


# Download the binaries.
mkdir -p "${OPT_DIR}"
fetch --repo="https://github.com/${REPO}" \
--tag="${VERSION}" \
--release-asset="${BINARY}" \
${OPT_DIR}
pushd "${OPT_DIR}"
curl -LO "https://github.com/${REPO}/releases/download/${VERSION}/${PROJECT}-${VERSION}-${PLATFORM}-${ARCH}"
popd

# Create the simlink
SRC="${OPT_DIR}/${BINARY}"
Expand Down

0 comments on commit 27c8c1e

Please sign in to comment.