Skip to content

Commit

Permalink
chore: Remove user/repo abstraction from install script
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Oct 5, 2024
1 parent 6866751 commit 5f98ac3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
9 changes: 3 additions & 6 deletions assets/scripts/install-local-bin.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions assets/scripts/install.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions internal/cmds/generate-install.sh/install.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
set -e

BINDIR="${BINDIR:-{{ .BinDir }}}"
CHEZMOI_USER_REPO="${CHEZMOI_USER_REPO:-twpayne/chezmoi}"
TAGARG=latest
LOG_LEVEL=2

GITHUB_DOWNLOAD="https://github.com/${CHEZMOI_USER_REPO}/releases/download"

tmpdir="$(mktemp -d)"
trap 'rm -rf -- "${tmpdir}"' EXIT
trap 'exit' INT TERM
Expand Down Expand Up @@ -76,12 +73,12 @@ main() {
# download tarball
NAME="chezmoi_${VERSION}_${GOOS}${GOOS_EXTRA}_${arch}"
TARBALL="${NAME}.${FORMAT}"
TARBALL_URL="${GITHUB_DOWNLOAD}/${TAG}/${TARBALL}"
TARBALL_URL="https://github.com/twpayne/chezmoi/releases/download/${TAG}/${TARBALL}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}" || exit 1

# download checksums
CHECKSUMS="chezmoi_${VERSION}_checksums.txt"
CHECKSUMS_URL="${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUMS}"
CHECKSUMS_URL="https://github.com/twpayne/chezmoi/releases/download/${TAG}/${CHECKSUMS}"
http_download "${tmpdir}/${CHECKSUMS}" "${CHECKSUMS_URL}" || exit 1

# verify checksums
Expand Down Expand Up @@ -186,7 +183,7 @@ get_libc() {
real_tag() {
tag="${1}"
log_debug "checking GitHub for tag ${tag}"
release_url="https://github.com/${CHEZMOI_USER_REPO}/releases/${tag}"
release_url="https://github.com/twpayne/chezmoi/releases/${tag}"
json="$(http_get "${release_url}" "Accept: application/json")"
if [ -z "${json}" ]; then
log_err "real_tag error retrieving GitHub release ${tag}"
Expand Down

0 comments on commit 5f98ac3

Please sign in to comment.