From 27c8c1e194c1ad4a23c16401bc1924138c9b5c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Greinhofer?= Date: Mon, 30 Mar 2020 15:34:05 -0500 Subject: [PATCH] Fix installer (#19) Removes unnecessary use of `GITHUB_TOKEN` and uses `curl` instead ` fetch`. Fixes rgreinho/tfe-cli#16 --- CHANGELOG.md | 4 +++- extras/tfe-cli-installer.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) mode change 100644 => 100755 extras/tfe-cli-installer.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index f417695..08a87d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/extras/tfe-cli-installer.sh b/extras/tfe-cli-installer.sh old mode 100644 new mode 100755 index 6395491..95577fc --- a/extras/tfe-cli-installer.sh +++ b/extras/tfe-cli-installer.sh @@ -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}"