1 Commits

Author SHA1 Message Date
Jason Swank
670b747a4b terraform-docs: add 2026-01-24 10:34:53 -05:00
19 changed files with 153 additions and 335 deletions

View File

@@ -1,80 +0,0 @@
name: Regenerate install scripts on Renovate PRs
on:
pull_request:
branches: [main]
paths:
- "config/*.binstaller.yml"
jobs:
regen:
if: startsWith(github.head_ref, 'renovate/')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install task
run: |
curl -sSL https://raw.githubusercontent.com/jswank/install/main/scripts/task-install.sh | bash
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
- name: Install binst
run: |
curl -sSL https://raw.githubusercontent.com/jswank/install/main/scripts/binstaller-install.sh | bash
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Detect changed configs
id: changed
run: |
changed=$(git diff --name-only origin/main...HEAD -- 'config/*.binstaller.yml' \
| sed 's|config/||;s|\.binstaller\.yml||' \
| tr '\n' ' ')
echo "binaries=${changed}" >> "$GITHUB_OUTPUT"
- name: Extract new versions from changed configs
id: versions
run: |
for binary in ${{ steps.changed.outputs.binaries }}; do
version=$(grep -oP '(?<=embedded_checksums:\n\s{4})(v[\d.]+)' \
"config/${binary}.binstaller.yml" || \
grep -A 1 'embedded_checksums:' "config/${binary}.binstaller.yml" \
| tail -1 | grep -oP 'v[\d.]+')
echo "${binary}=${version}" >> "$GITHUB_OUTPUT"
done
- name: Re-embed checksums and regenerate scripts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for binary in ${{ steps.changed.outputs.binaries }}; do
version=$(grep -A 1 'embedded_checksums:' "config/${binary}.binstaller.yml" \
| tail -1 | grep -oP 'v[\d.]+')
echo "Regenerating ${binary} at ${version}"
binst embed-checksums \
--config "config/${binary}.binstaller.yml" \
--version "${version}" \
--mode download
binst gen \
--config "config/${binary}.binstaller.yml" \
-o "scripts/${binary}-install.sh"
done
- name: Commit regenerated scripts
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add scripts/
git diff --cached --quiet || git commit -m "chore: regenerate install scripts"
git push

205
README.md
View File

@@ -1,177 +1,104 @@
# binst # binst
A curated collection of portable installation scripts for binary tools, powered by [binstaller](https://github.com/binary-install/binstaller). A collection of installation scripts for binary tools, generated using [binstaller](https://github.com/binary-install/binstaller). These scripts are portable POSIX shell scripts that work across Linux, macOS, and Windows (Git Bash/WSL) and are designed to be a simple, secure way to install self-contained binaries from GitHub releases.
## Overview * [Quick Start](#quick-start)
* [Workflows](#workflows)
This repository provides POSIX-compliant shell scripts that simplify the installation of popular binary tools from GitHub releases. Each script is: * [Creating New Installation Scripts](#creating-new-installation-scripts)
* [Notes](#notes)
- **Portable**: Works across Linux, macOS, and Windows (Git Bash/WSL) * [Binary Names](#binary-names)
- **Secure**: Includes checksum verification for downloaded binaries
- **Simple**: Single command installation with no dependencies
- **Self-contained**: No package manager or runtime required
## Table of Contents
- [Quick Start](#quick-start)
- [Available Tools](#available-tools)
- [Usage](#usage)
- [Installing Binaries](#installing-binaries)
- [Using Task Commands](#using-task-commands)
- [Creating New Scripts](#creating-new-scripts)
- [Prerequisites](#prerequisites)
- [Automatic Generation](#automatic-generation)
- [Manual Configuration](#manual-configuration)
- [Configuration](#configuration)
- [Binary Names](#binary-names)
- [Contributing](#contributing)
- [License](#license)
## Quick Start ## Quick Start
Install any binary directly using its installation script: Install any binary using its generated script:
```bash ```bash
# Install trufflehog # install trufflehog
./scripts/trufflehog-install.sh $ scripts/trufflehog-install.sh
# Install task # install task
./scripts/task-install.sh $ scripts/task-install.sh
# Install checkov
./scripts/checkov-install.sh
``` ```
Binaries are installed to `~/.local/bin` by default (customizable via environment variables). ## Workflows
## Available Tools Common workflows for the creation, maintenance, usage of the installation scripts are encapsulated in [Task](https://taskfile.dev) tasks.
Installation scripts are located in the `scripts/` directory. Run `ls scripts/` to see all available tools, or browse the directory on GitHub.
## Usage
### Installing Binaries
Run any installation script directly:
```bash ```bash
./scripts/<tool-name>-install.sh # list available tasks
$ task --list
task: Available tasks for this project:
* default: Create a new installation script for a binary
* embed-checksums: Embed checksums into a binst configuration file.
* gen: Generate installation script from binst configuration.
* init: Initialize binst configuration for a GitHub project.
* install-*: Install a binary using its installation script.
* latest-release: Determine the latest release available for a given repo.
# install a binary
$ task install-trufflehog
``` ```
The script will: ### Creating New Installation Scripts
1. Detect your OS and architecture
2. Download the latest release from GitHub
3. Verify checksums
4. Install the binary to your PATH
### Using Task Commands The default task uses binstaller to creates a new installation script for a binary from
its GitHub repository. This is often the only step needed to add a new installation
This repository includes [Taskfile](https://taskfile.dev) automation for common workflows: script to the collection.
To install binstaller, run:
```bash ```bash
# List all available tasks $ scripts/binstaller-install.sh
task --list
# Install a specific binary via Task
task install-trufflehog
task install-aichat
task install-checkov
``` ```
Available tasks: To create a new installation script:
- `task` - Create a new installation script (requires `REPO` variable)
- `task install-*` - Install a binary using its script
- `task init` - Initialize binstaller configuration for a GitHub project
- `task embed-checksums` - Embed checksums into a configuration file
- `task gen` - Generate installation script from configuration
- `task latest-release` - Check the latest release version
## Creating New Scripts
### Prerequisites
First, install binstaller:
```bash ```bash
./scripts/binstaller-install.sh # create a new installation script by providing the GitHub repository as an argument:
$ task REPO=owner/repo-name
# detailes summary
$ task --summary
task: default
Create a new installation script for a binary by initializing a binst config,
embedding checksums, and generating the installation script. The latest release, as
determined by the latest-release task, will be used unless a specific version is
provided.
Invoke this task like:
task default REPO=trufflesecurity/trufflehog
vars:
CONFIG_DIR: "./config"
SCRIPT_DIR: "./scripts"
BINARY: "{{.REPO | base}}"
VERSION: "latest"
requires:
vars:
- REPO
commands:
- Task: init
- Task: embed-checksums
- Task: gen
``` ```
### Automatic Generation ## Notes
The easiest way to add a new installation script is using the default Task workflow:
```bash
# Create script for a GitHub repository
task REPO=owner/repo-name
# Example: Add installation script for trufflehog
task REPO=trufflesecurity/trufflehog
```
This command will:
1. Initialize a binstaller configuration file
2. Fetch and embed checksums from the latest release
3. Generate the installation script
For more details on the default task:
```bash
task --summary
```
### Manual Configuration
For advanced use cases, you can manually create or edit configuration files:
1. **Initialize configuration**:
```bash
task init REPO=owner/repo-name
```
2. **Edit the configuration** in `config/repo-name.binstaller.yml` as needed
3. **Embed checksums**:
```bash
task embed-checksums BINARY=repo-name
```
4. **Generate the script**:
```bash
task gen BINARY=repo-name
```
## Configuration
### Binary Names ### Binary Names
In some cases, the binary executable name differs from the GitHub repository name. When this occurs, specify the actual binary name in the `asset.binaries` section of the configuration file. Sometimes the binary executable name differs from the GitHub repository name. When this occurs, the `asset.binaries` section in the configuration file defines the actual binary name. If this is the case, the generated installation script will need to be manually edited.
**Example**: The [stacklok/toolhive](https://github.com/stacklok/toolhive) repository releases a binary named `thv`. The [configuration file](config/toolhive.binstaller.yml) handles this: As an example, the released artifact for [stacklok/toolhive](https://github.com/stacklok/toolhive) is named `thv` rather than `toolhive`. The [configuration file](config/toolhive.binstaller.yml) specifies the correct name for the binary in the `asset.binaries` section.
```yaml ```yaml
repo: stacklok/toolhive repo: stacklok/toolhive
asset: asset:
binaries: binaries:
- name: thv - name: thv
path: thv path: thv
``` ```
After generation, you may wish to rename the installation script from `thv-install.sh` to `toolhive-install.sh` for consistency.
## Contributing
Contributions are welcome! To add a new binary installation script:
1. Fork this repository
2. Create a new script using `task REPO=owner/repo-name`
3. Test the installation script
4. Submit a pull request
Please ensure:
- The binary is a popular, well-maintained tool
- The installation script works across all supported platforms
- Checksums are embedded for security
## License ## License
MIT. See [LICENSE](LICENSE) for details. MIT. See [LICENSE](LICENSE) for details.

View File

@@ -26,7 +26,7 @@ asset:
checksums: checksums:
algorithm: sha256 algorithm: sha256
embedded_checksums: embedded_checksums:
v0.30.0: # renovate: datasource=github-releases depName=sigoden/aichat v0.30.0:
- filename: aichat-v0.30.0-aarch64-apple-darwin.tar.gz - filename: aichat-v0.30.0-aarch64-apple-darwin.tar.gz
hash: 680d36ed7f7ba8a2c2490a099df26c9da54495903c27956109a89c87eeb9edb3 hash: 680d36ed7f7ba8a2c2490a099df26c9da54495903c27956109a89c87eeb9edb3
- filename: aichat-v0.30.0-aarch64-pc-windows-msvc.zip - filename: aichat-v0.30.0-aarch64-pc-windows-msvc.zip

View File

@@ -4,9 +4,6 @@ repo: binary-install/binstaller
asset: asset:
template: binst_${OS}_${ARCH}${EXT} template: binst_${OS}_${ARCH}${EXT}
default_extension: .tar.gz default_extension: .tar.gz
binaries:
- name: binst
path: binst
rules: rules:
- when: - when:
arch: amd64 arch: amd64
@@ -23,19 +20,3 @@ asset:
- when: - when:
os: windows os: windows
ext: .zip ext: .zip
checksums:
algorithm: sha256
embedded_checksums:
v0.12.0: # renovate: datasource=github-releases depName=binary-install/binstaller
- filename: binst_Darwin_arm64.tar.gz
hash: 2c3a8cf9b8f95edb5d97b905ccb0204800b25f1a9bc2b4ad704596e756e41eb9
- filename: binst_Darwin_x86_64.tar.gz
hash: bd9eae149f5735671bf1f32204f5ba9f10de269a290755f21f93bf1bb5d09b03
- filename: binst_Linux_arm64.tar.gz
hash: 76bca4884ee3fa229d915473ddd53ab4d04c34c9e4b5a1eda36d9751763af916
- filename: binst_Linux_x86_64.tar.gz
hash: af36ebb92c01ad4b9867a79eb45d1a130efbce20930896ec7578b3746416ee41
- filename: binst_Windows_arm64.zip
hash: 133784089efd57f5a0164b84ac74c4924c299342c88eb40be65155193ca37761
- filename: binst_Windows_x86_64.zip
hash: afcc9eab78de6bfa1ce360aebbf1a48738c519cdbe6a9560e6979ec3a4fcb4ef

View File

@@ -21,7 +21,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: eksctl_checksums.txt template: eksctl_checksums.txt
embedded_checksums: embedded_checksums:
v0.221.0: # renovate: datasource=github-releases depName=eksctl-io/eksctl v0.221.0:
- filename: eksctl_Darwin_amd64.tar.gz - filename: eksctl_Darwin_amd64.tar.gz
hash: 9a5a3370ed79ffa646e25a0115aa7ee7fa203b284dffe058135b353be1542752 hash: 9a5a3370ed79ffa646e25a0115aa7ee7fa203b284dffe058135b353be1542752
- filename: eksctl_Darwin_arm64.tar.gz - filename: eksctl_Darwin_arm64.tar.gz

View File

@@ -11,7 +11,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: checksums.txt template: checksums.txt
embedded_checksums: embedded_checksums:
v2.0.0: # renovate: datasource=github-releases depName=ekalinin/github-markdown-toc.go v2.0.0:
- filename: gh-md-toc_2.0.0_darwin_amd64.tar.gz - filename: gh-md-toc_2.0.0_darwin_amd64.tar.gz
hash: 622626f7880f6b604e93c06638e948500f4b458703d4066e91bae5b857934666 hash: 622626f7880f6b604e93c06638e948500f4b458703d4066e91bae5b857934666
- filename: gh-md-toc_2.0.0_darwin_arm64.tar.gz - filename: gh-md-toc_2.0.0_darwin_arm64.tar.gz

View File

@@ -1,18 +0,0 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/binary-install/binstaller/main/schema/InstallSpec.json
schema: v1
repo: rubrical-studios/gh-pmu
asset:
template: ${OS}-${ARCH}${EXT}
checksums:
algorithm: sha256
template: checksums.txt
embedded_checksums:
v0.14.3: # renovate: datasource=github-releases depName=rubrical-studios/gh-pmu
- filename: darwin-amd64
hash: 0a07dea041d1a76683884ae82fd9c4ecf8569c01d5bc03168b5dd15da471637a
- filename: darwin-arm64
hash: 4401d839d0e15511ec478a0008e66338e9fa407437bf7aee52ec003f2b99e38c
- filename: linux-amd64
hash: 3519a08f7f82e635acb5df755855b6cfd754f73603d59a5958ded2be7dac14fb
- filename: linux-arm64
hash: be4f3e9e4691bffe121a40240e94359b5b00f7fad844a29e497fb7b01d89b1b3

View File

@@ -8,7 +8,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: tofu_${VERSION}_SHA256SUMS template: tofu_${VERSION}_SHA256SUMS
embedded_checksums: embedded_checksums:
v1.11.4: # renovate: datasource=github-releases depName=opentofu/opentofu v1.11.4:
- filename: tofu_1.11.4_darwin_amd64.tar.gz - filename: tofu_1.11.4_darwin_amd64.tar.gz
hash: 46abdd10b826e864f6daf2013a6f0dbc079d8c6e0f79b529138b7da50bea502f hash: 46abdd10b826e864f6daf2013a6f0dbc079d8c6e0f79b529138b7da50bea502f
- filename: tofu_1.11.4_darwin_arm64.tar.gz - filename: tofu_1.11.4_darwin_arm64.tar.gz

View File

@@ -12,7 +12,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: task_checksums.txt template: task_checksums.txt
embedded_checksums: embedded_checksums:
v3.46.4: # renovate: datasource=github-releases depName=go-task/task v3.46.4:
- filename: task_darwin_amd64.tar.gz - filename: task_darwin_amd64.tar.gz
hash: 6e3d1bf5fcc03e50b2c02c92335923b715d3f61e27fef5b3048b59ed97a18721 hash: 6e3d1bf5fcc03e50b2c02c92335923b715d3f61e27fef5b3048b59ed97a18721
- filename: task_darwin_arm64.tar.gz - filename: task_darwin_arm64.tar.gz

View File

@@ -39,7 +39,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: tenv_${TAG}_checksums.txt template: tenv_${TAG}_checksums.txt
embedded_checksums: embedded_checksums:
v4.9.0: # renovate: datasource=github-releases depName=tofuutils/tenv v4.9.0:
- filename: tenv_v4.9.0_Darwin_arm64.tar.gz - filename: tenv_v4.9.0_Darwin_arm64.tar.gz
hash: 9fe1bea568d89c877198caa3af8cdf78c44263aedd6117feb783be4f242bf09b hash: 9fe1bea568d89c877198caa3af8cdf78c44263aedd6117feb783be4f242bf09b
- filename: tenv_v4.9.0_Darwin_x86_64.tar.gz - filename: tenv_v4.9.0_Darwin_x86_64.tar.gz

View File

@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/binary-install/binstaller/main/schema/InstallSpec.json
schema: v1
repo: terraform-docs/terraform-docs
asset:
template: terraform-docs-${TAG}-${OS}-${ARCH}${EXT}
default_extension: .tar.gz
rules:
- when:
os: windows
ext: .zip
checksums:
algorithm: sha256
template: terraform-docs-${TAG}.sha256sum
embedded_checksums:
v0.21.0:
- filename: terraform-docs-v0.21.0-darwin-amd64.tar.gz
hash: ddf4b53925d857ae81210ebeda32b429a17385d6e4561ab1972067a9ccb36873
- filename: terraform-docs-v0.21.0-darwin-arm64.tar.gz
hash: 92d6988d8c59c25aa1724068f4bc2d0f01a9d4706077e258e946e944ad7eee03
- filename: terraform-docs-v0.21.0-freebsd-amd64.tar.gz
hash: 0be85796f3709a5b42807b8d25cb5c4c8d0fd1c1dc7aa14388c212c34376a638
- filename: terraform-docs-v0.21.0-freebsd-arm.tar.gz
hash: 5b2e3e0cf7e71cadec2f493b2aca017d8ff10536090f41764ac73bf598b9acb7
- filename: terraform-docs-v0.21.0-freebsd-arm64.tar.gz
hash: 775e1bf444917d8706890f66eb0f2af535a436c5d6b03a31f0b29d79e27e5ed2
- filename: terraform-docs-v0.21.0-linux-amd64.tar.gz
hash: 2fdd81b8d21ff1498cd559af0dcc5d155835f84600db06d3923e217124fc735a
- filename: terraform-docs-v0.21.0-linux-arm.tar.gz
hash: bf05a610710c25551b66a8b536a5b945da8fa26b8d68a2ade4af59119492e4f5
- filename: terraform-docs-v0.21.0-linux-arm64.tar.gz
hash: 35b2e6846268841484e6eea7d00d7dfe2c94b4725e52cfe19aa6c26a86c32edc
- filename: terraform-docs-v0.21.0-windows-amd64.zip
hash: 9f45957d50656ec91c6172d73a6c9e6a22df2ccc7ca880cf288d19d6f5e349db
- filename: terraform-docs-v0.21.0-windows-arm64.zip
hash: a9ca3577209b2c5f21a0d89afdee82e6ad912058d64c364b7a7535abb57e3092

View File

@@ -8,7 +8,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: checksums.txt template: checksums.txt
embedded_checksums: embedded_checksums:
v0.60.0: # renovate: datasource=github-releases depName=terraform-linters/tflint v0.60.0:
- filename: tflint_darwin_amd64.zip - filename: tflint_darwin_amd64.zip
hash: 256f70ad2c9963690bccc31ffda6be0159f1c5f857b46773b70d01d56b711280 hash: 256f70ad2c9963690bccc31ffda6be0159f1c5f857b46773b70d01d56b711280
- filename: tflint_darwin_arm64.zip - filename: tflint_darwin_arm64.zip

View File

@@ -41,16 +41,3 @@ checksums:
hash: 192bb1f0f9f257cad232e0148d81c3e31e644b888e61c22b46fa15b6b760547e hash: 192bb1f0f9f257cad232e0148d81c3e31e644b888e61c22b46fa15b6b760547e
- filename: toolhive_0.8.0_windows_arm64.zip - filename: toolhive_0.8.0_windows_arm64.zip
hash: 313931641136da7479f02caf351c955c2d1d9bbc7204dff5f7f9d61ca1fd9242 hash: 313931641136da7479f02caf351c955c2d1d9bbc7204dff5f7f9d61ca1fd9242
v0.9.2: # renovate: datasource=github-releases depName=stacklok/toolhive
- filename: toolhive_0.9.2_darwin_amd64.tar.gz
hash: f8e45af89346a93678ed628552e68dae19a04f0b7402e1e545e5a53dd68ddb38
- filename: toolhive_0.9.2_darwin_arm64.tar.gz
hash: 29595e175cf60c3b8419754a5e384c530a84d63b506dd240372e55ba07290434
- filename: toolhive_0.9.2_linux_amd64.tar.gz
hash: 70be3936c37f98f5582aabc5b455e9f89ec797146cd69485484129e95f607185
- filename: toolhive_0.9.2_linux_arm64.tar.gz
hash: a9bdac8893adbfbd3b1491155b54f825cb82e084a837422e12a1de72dcd574ba
- filename: toolhive_0.9.2_windows_amd64.zip
hash: e8c73681a2ccf55396497d5b6066811f2e059776e2444ec35daa3a0a74267e66
- filename: toolhive_0.9.2_windows_arm64.zip
hash: d42f5149287fd0b37f517724272421b14d4732e036d35e0a908deece836f7500

View File

@@ -24,7 +24,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: trivy_${VERSION}_checksums.txt template: trivy_${VERSION}_checksums.txt
embedded_checksums: embedded_checksums:
v0.68.2: # renovate: datasource=github-releases depName=aquasecurity/trivy v0.68.2:
- filename: trivy_0.68.2_Linux-64bit.tar.gz - filename: trivy_0.68.2_Linux-64bit.tar.gz
hash: 3d933bbc3685f95ec15280f620583d05d97ee3affb66944d14481d5d6d567064 hash: 3d933bbc3685f95ec15280f620583d05d97ee3affb66944d14481d5d6d567064
- filename: trivy_0.68.2_Linux-ARM64.tar.gz - filename: trivy_0.68.2_Linux-ARM64.tar.gz

View File

@@ -8,7 +8,7 @@ checksums:
algorithm: sha256 algorithm: sha256
template: trufflehog_${VERSION}_checksums.txt template: trufflehog_${VERSION}_checksums.txt
embedded_checksums: embedded_checksums:
v3.92.4: # renovate: datasource=github-releases depName=trufflesecurity/trufflehog v3.92.4:
- filename: trufflehog_3.92.4_darwin_amd64.tar.gz - filename: trufflehog_3.92.4_darwin_amd64.tar.gz
hash: 7599e25b2d9c8eea30aac873114bad54cb254a3dbc4b01cac52b28ef9f013f0e hash: 7599e25b2d9c8eea30aac873114bad54cb254a3dbc4b01cac52b28ef9f013f0e
- filename: trufflehog_3.92.4_darwin_arm64.tar.gz - filename: trufflehog_3.92.4_darwin_arm64.tar.gz

View File

@@ -1,18 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"minimumReleaseAge": "7 days",
"labels": ["renovate", "dependencies"],
"schedule": ["before 9am on monday"],
"prConcurrentLimit": 5,
"regexManagers": [
{
"fileMatch": ["^config/[^/]+\\.binstaller\\.yml$"],
"matchStrings": [
"\\s+(?<currentValue>v[\\d.]+):\\s+#\\s+renovate:\\s+datasource=(?<datasource>[^\\s]+)\\s+depName=(?<depName>[^\\s]+)"
],
"datasourceTemplate": "{{datasource}}",
"depNameTemplate": "{{depName}}"
}
]
}

View File

@@ -503,7 +503,7 @@ cleanup() {
execute() { execute() {
STRIP_COMPONENTS=0 STRIP_COMPONENTS=0
CHECKSUM_FILENAME="" CHECKSUM_FILENAME="checksums.txt"
# --- Construct URLs --- # --- Construct URLs ---
GITHUB_DOWNLOAD="https://github.com/${REPO}/releases/download" GITHUB_DOWNLOAD="https://github.com/${REPO}/releases/download"
@@ -552,11 +552,11 @@ execute() {
log_info "Extracting ${ASSET_FILENAME}..." log_info "Extracting ${ASSET_FILENAME}..."
(cd "${TMPDIR}" && untar "${ASSET_FILENAME}" "${STRIP_COMPONENTS}") (cd "${TMPDIR}" && untar "${ASSET_FILENAME}" "${STRIP_COMPONENTS}")
fi fi
BINARY_NAME='binst' BINARY_NAME='binstaller'
if [ -z "${EXT}" ] || [ "${EXT}" = ".exe" ]; then if [ -z "${EXT}" ] || [ "${EXT}" = ".exe" ]; then
BINARY_PATH="${TMPDIR}/${ASSET_FILENAME}" BINARY_PATH="${TMPDIR}/${ASSET_FILENAME}"
else else
BINARY_PATH="${TMPDIR}/binst" BINARY_PATH="${TMPDIR}/binstaller"
fi fi
if [ "${UNAME_OS}" = "windows" ]; then if [ "${UNAME_OS}" = "windows" ]; then

View File

@@ -13,7 +13,7 @@ Usage: $this [-b bindir] [-d] [-q] [-n] [tag]
-q turns on quiet mode (errors only) -q turns on quiet mode (errors only)
-n turns on dry run mode -n turns on dry run mode
[tag] is a tag from [tag] is a tag from
https://github.com/rubrical-studios/gh-pmu/releases https://github.com/terraform-docs/terraform-docs/releases
If tag is missing, then latest will be used. If tag is missing, then latest will be used.
Environment variables: Environment variables:
@@ -410,10 +410,16 @@ github_release() {
# --- Embedded Checksums (Format: VERSION:FILENAME:HASH) --- # --- Embedded Checksums (Format: VERSION:FILENAME:HASH) ---
EMBEDDED_CHECKSUMS=" EMBEDDED_CHECKSUMS="
0.14.3:darwin-amd64:0a07dea041d1a76683884ae82fd9c4ecf8569c01d5bc03168b5dd15da471637a 0.21.0:terraform-docs-v0.21.0-darwin-amd64.tar.gz:ddf4b53925d857ae81210ebeda32b429a17385d6e4561ab1972067a9ccb36873
0.14.3:darwin-arm64:4401d839d0e15511ec478a0008e66338e9fa407437bf7aee52ec003f2b99e38c 0.21.0:terraform-docs-v0.21.0-darwin-arm64.tar.gz:92d6988d8c59c25aa1724068f4bc2d0f01a9d4706077e258e946e944ad7eee03
0.14.3:linux-amd64:3519a08f7f82e635acb5df755855b6cfd754f73603d59a5958ded2be7dac14fb 0.21.0:terraform-docs-v0.21.0-freebsd-amd64.tar.gz:0be85796f3709a5b42807b8d25cb5c4c8d0fd1c1dc7aa14388c212c34376a638
0.14.3:linux-arm64:be4f3e9e4691bffe121a40240e94359b5b00f7fad844a29e497fb7b01d89b1b3" 0.21.0:terraform-docs-v0.21.0-freebsd-arm.tar.gz:5b2e3e0cf7e71cadec2f493b2aca017d8ff10536090f41764ac73bf598b9acb7
0.21.0:terraform-docs-v0.21.0-freebsd-arm64.tar.gz:775e1bf444917d8706890f66eb0f2af535a436c5d6b03a31f0b29d79e27e5ed2
0.21.0:terraform-docs-v0.21.0-linux-amd64.tar.gz:2fdd81b8d21ff1498cd559af0dcc5d155835f84600db06d3923e217124fc735a
0.21.0:terraform-docs-v0.21.0-linux-arm.tar.gz:bf05a610710c25551b66a8b536a5b945da8fa26b8d68a2ade4af59119492e4f5
0.21.0:terraform-docs-v0.21.0-linux-arm64.tar.gz:35b2e6846268841484e6eea7d00d7dfe2c94b4725e52cfe19aa6c26a86c32edc
0.21.0:terraform-docs-v0.21.0-windows-amd64.zip:9f45957d50656ec91c6172d73a6c9e6a22df2ccc7ca880cf288d19d6f5e349db
0.21.0:terraform-docs-v0.21.0-windows-arm64.zip:a9ca3577209b2c5f21a0d89afdee82e6ad912058d64c364b7a7535abb57e3092"
# Find embedded checksum for a given version and filename # Find embedded checksum for a given version and filename
find_embedded_checksum() { find_embedded_checksum() {
@@ -464,8 +470,12 @@ resolve_asset_filename() {
# --- Apply Rules --- # --- Apply Rules ---
ASSET_FILENAME="" ASSET_FILENAME=""
if [ "${UNAME_OS}" = 'windows' ] && true
then
EXT='.zip'
fi
if [ -z "${ASSET_FILENAME}" ]; then if [ -z "${ASSET_FILENAME}" ]; then
ASSET_FILENAME="${OS}-${ARCH}${EXT}" ASSET_FILENAME="terraform-docs-${TAG}-${OS}-${ARCH}${EXT}"
fi fi
} }
# Cleanup function to remove temporary files and stop progress # Cleanup function to remove temporary files and stop progress
@@ -481,7 +491,7 @@ cleanup() {
execute() { execute() {
STRIP_COMPONENTS=0 STRIP_COMPONENTS=0
CHECKSUM_FILENAME="checksums.txt" CHECKSUM_FILENAME="terraform-docs-${TAG}.sha256sum"
# --- Construct URLs --- # --- Construct URLs ---
GITHUB_DOWNLOAD="https://github.com/${REPO}/releases/download" GITHUB_DOWNLOAD="https://github.com/${REPO}/releases/download"
@@ -530,11 +540,11 @@ execute() {
log_info "Extracting ${ASSET_FILENAME}..." log_info "Extracting ${ASSET_FILENAME}..."
(cd "${TMPDIR}" && untar "${ASSET_FILENAME}" "${STRIP_COMPONENTS}") (cd "${TMPDIR}" && untar "${ASSET_FILENAME}" "${STRIP_COMPONENTS}")
fi fi
BINARY_NAME='gh-pmu' BINARY_NAME='terraform-docs'
if [ -z "${EXT}" ] || [ "${EXT}" = ".exe" ]; then if [ -z "${EXT}" ] || [ "${EXT}" = ".exe" ]; then
BINARY_PATH="${TMPDIR}/${ASSET_FILENAME}" BINARY_PATH="${TMPDIR}/${ASSET_FILENAME}"
else else
BINARY_PATH="${TMPDIR}/${ASSET_FILENAME}" BINARY_PATH="${TMPDIR}/terraform-docs"
fi fi
if [ "${UNAME_OS}" = "windows" ]; then if [ "${UNAME_OS}" = "windows" ]; then
@@ -568,9 +578,9 @@ execute() {
} }
# --- Configuration --- # --- Configuration ---
NAME='gh-pmu' NAME='terraform-docs'
REPO='rubrical-studios/gh-pmu' REPO='terraform-docs/terraform-docs'
EXT='' EXT='.tar.gz'
# use in logging routines # use in logging routines
log_prefix() { log_prefix() {

View File

@@ -421,13 +421,7 @@ EMBEDDED_CHECKSUMS="
0.8.0:toolhive_0.8.0_linux_amd64.tar.gz:2f4216bdefdc37bda46ee5c896c54920d65e18013a0627855ce1a16eb2c44726 0.8.0:toolhive_0.8.0_linux_amd64.tar.gz:2f4216bdefdc37bda46ee5c896c54920d65e18013a0627855ce1a16eb2c44726
0.8.0:toolhive_0.8.0_linux_arm64.tar.gz:3b806cf7b857b0dce819610b4ef48709d35ee10a73865dfca4fcc791bff80416 0.8.0:toolhive_0.8.0_linux_arm64.tar.gz:3b806cf7b857b0dce819610b4ef48709d35ee10a73865dfca4fcc791bff80416
0.8.0:toolhive_0.8.0_windows_amd64.zip:192bb1f0f9f257cad232e0148d81c3e31e644b888e61c22b46fa15b6b760547e 0.8.0:toolhive_0.8.0_windows_amd64.zip:192bb1f0f9f257cad232e0148d81c3e31e644b888e61c22b46fa15b6b760547e
0.8.0:toolhive_0.8.0_windows_arm64.zip:313931641136da7479f02caf351c955c2d1d9bbc7204dff5f7f9d61ca1fd9242 0.8.0:toolhive_0.8.0_windows_arm64.zip:313931641136da7479f02caf351c955c2d1d9bbc7204dff5f7f9d61ca1fd9242"
0.9.2:toolhive_0.9.2_darwin_amd64.tar.gz:f8e45af89346a93678ed628552e68dae19a04f0b7402e1e545e5a53dd68ddb38
0.9.2:toolhive_0.9.2_darwin_arm64.tar.gz:29595e175cf60c3b8419754a5e384c530a84d63b506dd240372e55ba07290434
0.9.2:toolhive_0.9.2_linux_amd64.tar.gz:70be3936c37f98f5582aabc5b455e9f89ec797146cd69485484129e95f607185
0.9.2:toolhive_0.9.2_linux_arm64.tar.gz:a9bdac8893adbfbd3b1491155b54f825cb82e084a837422e12a1de72dcd574ba
0.9.2:toolhive_0.9.2_windows_amd64.zip:e8c73681a2ccf55396497d5b6066811f2e059776e2444ec35daa3a0a74267e66
0.9.2:toolhive_0.9.2_windows_arm64.zip:d42f5149287fd0b37f517724272421b14d4732e036d35e0a908deece836f7500"
# Find embedded checksum for a given version and filename # Find embedded checksum for a given version and filename
find_embedded_checksum() { find_embedded_checksum() {