Skip to content

Commit

Permalink
install: fixed install script for tarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Feb 19, 2021
1 parent e831ced commit a97ff20
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ parse_args() {
execute() {
tmpdir=$(mktemp -d)
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${FILENAME}" "${FILE_URL}"
http_download "${tmpdir}/${TARBALL}" "${FILE_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${FILENAME}" "${tmpdir}/${CHECKSUM}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
test ! -d "${BINDIR}" && install -d "${BINDIR}"
Expand All @@ -55,10 +55,10 @@ execute() {
binexe="${binexe}.exe"
fi
if test -w "${BINDIR}/${binexe}"; then
install "${srcdir}/${FILENAME}" "${BINDIR}/${binexe}"
install "${srcdir}/${binexe}" "${BINDIR}/${binexe}"
else
log_info "not allowed to install binary without higher privilege"
sudo install "${srcdir}/${FILENAME}" "${BINDIR}/${binexe}"
sudo install "${srcdir}/${binexe}" "${BINDIR}/${binexe}"
fi
log_info "installed ${BINDIR}/${binexe}"
done
Expand Down Expand Up @@ -367,7 +367,7 @@ PROJECT_NAME="multi-gitter"
OWNER=lindell
REPO="multi-gitter"
BINARY=multi-gitter
FORMAT=""
FORMAT="tar.gz"
OS=$(uname_os)
ARCH=$(uname_arch)
PREFIX="$OWNER/$REPO"
Expand Down Expand Up @@ -397,8 +397,8 @@ adjust_arch
log_info "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}"

NAME=${BINARY}_${VERSION}_${OS}_${ARCH}
FILENAME=${NAME}${FORMAT}
FILE_URL=${GITHUB_DOWNLOAD}/${TAG}/${FILENAME}
TARBALL=${NAME}.${FORMAT}
FILE_URL=${GITHUB_DOWNLOAD}/${TAG}/${TARBALL}
CHECKSUM=checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUM}

Expand Down

0 comments on commit a97ff20

Please sign in to comment.