Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/atuin.sh/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atuin.sh",
"id": "atuin.sh",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"atuin\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/atuin.sh",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/atuin.sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='atuinsh/atuin'
readonly binaryName='atuin'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}-${architecture}-unknown-linux-gnu.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}-${architecture}-unknown-linux-gnu.tar.gz'
readonly binaryPathInArchiveTemplate='${name}-${architecture}-unknown-linux-gnu/${binaryName}'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
Expand Down Expand Up @@ -113,6 +113,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -130,6 +142,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$(echo -n "$binaryPathInArchiveTemplate" | envsubst)"
Expand Down
2 changes: 1 addition & 1 deletion src/btop/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "btop",
"id": "btop",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"btop\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/btop",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/btop/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='aristocratos/btop'
readonly binaryName='btop'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}-${architecture}-linux-musl.tbz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}-${architecture}-linux-musl.tbz'
readonly binaryPathInArchiveTemplate='./btop/bin/${binaryName}'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
Expand Down Expand Up @@ -113,6 +113,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -131,6 +143,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$(echo -n "$binaryPathInArchiveTemplate" | envsubst)"
Expand Down
2 changes: 1 addition & 1 deletion src/charmbracelet-gum/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "charmbracelet/gum",
"id": "charmbracelet-gum",
"version": "1.0.2",
"version": "1.0.3",
"description": "Install \"gum\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/charmbracelet-gum",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/charmbracelet-gum/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='charmbracelet/gum'
readonly binaryName='gum'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}_${version}_Linux_${architecture}.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}_${version}_Linux_${architecture}.tar.gz'
readonly binaryPathInArchiveTemplate='${name}_${version}_Linux_${architecture}/${binaryName}'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
Expand Down Expand Up @@ -111,6 +111,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -128,6 +140,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$(echo -n "$binaryPathInArchiveTemplate" | envsubst)"
Expand Down
2 changes: 1 addition & 1 deletion src/chezmoi.io/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chezmoi.io",
"id": "chezmoi.io",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"chezmoi\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/chezmoi.io",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/chezmoi.io/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='twpayne/chezmoi'
readonly binaryName='chezmoi'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}_${version}_linux_${architecture}.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}_${version}_linux_${architecture}.tar.gz'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
apt_get_update() {
Expand Down Expand Up @@ -103,6 +103,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -120,6 +132,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$binaryName"
Expand Down
2 changes: 1 addition & 1 deletion src/jj-vcs.dev/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jj-vcs.dev",
"id": "jj-vcs.dev",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"jj\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jj-vcs.dev",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/jj-vcs.dev/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='jj-vcs/jj'
readonly binaryName='jj'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}-v${version}-${architecture}-unknown-linux-musl.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}-${releaseTag}-${architecture}-unknown-linux-musl.tar.gz'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
apt_get_update() {
Expand Down Expand Up @@ -112,6 +112,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -129,6 +141,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="./$binaryName"
Expand Down
2 changes: 1 addition & 1 deletion src/opencode.ai/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencode.ai",
"id": "opencode.ai",
"version": "1.0.1",
"version": "1.0.2",
"description": "Install \"opencode\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/opencode.ai",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/opencode.ai/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='anomalyco/opencode'
readonly binaryName='opencode'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}-linux-${architecture}.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}-linux-${architecture}.tar.gz'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
apt_get_update() {
Expand Down Expand Up @@ -106,6 +106,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -123,6 +135,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryTargetPath="$(echo -n "$binaryTargetPathTemplate" | envsubst)"
Expand Down
2 changes: 1 addition & 1 deletion src/smallstep.com/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "smallstep.com",
"id": "smallstep.com",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"step\" cli binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/smallstep.com",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/smallstep.com/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='smallstep/cli'
readonly binaryName='step'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/step_linux_${version}_${architecture}.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/step_linux_${version}_${architecture}.tar.gz'
readonly binaryPathInArchiveTemplate='step_${version}/bin/${binaryName}'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
Expand Down Expand Up @@ -108,6 +108,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -125,6 +137,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$(echo -n "$binaryPathInArchiveTemplate" | envsubst)"
Expand Down
2 changes: 1 addition & 1 deletion src/starship.rs/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "starship.rs",
"id": "starship.rs",
"version": "1.0.0",
"version": "1.0.1",
"description": "Install \"starship\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/starship.rs",
"options": {
Expand Down
19 changes: 18 additions & 1 deletion src/starship.rs/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o allexport
readonly githubRepository='starship/starship'
readonly binaryName='starship'
readonly versionArgument='--version'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/v${version}/${name}-${architecture}-unknown-linux-musl.tar.gz'
readonly downloadUrlTemplate='https://github.com/${githubRepository}/releases/download/${releaseTag}/${name}-${architecture}-unknown-linux-musl.tar.gz'
readonly binaryPathInArchiveTemplate='${binaryName}'
readonly binaryTargetFolder='/usr/local/bin'
readonly name="${githubRepository##*/}"
Expand Down Expand Up @@ -113,6 +113,18 @@ github_get_latest_release() {
fi
github_list_releases "$1" | head -n 1
}
github_get_tag_for_version() {
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: github_get_tag_for_version <owner/repo> <version>"
return 1
fi
local repo="$1"
local version="$2"
local url="https://api.github.com/repos/$repo/releases"
local escaped_version
escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
curl -s "$url" | grep -Po '"tag_name": "\K.*?(?=")' | grep -E "^v?${escaped_version}$" | head -n 1
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
Expand All @@ -130,6 +142,11 @@ install() {
VERSION=$(github_get_latest_release "$githubRepository")
fi
readonly version="${VERSION:?}"
readonly releaseTag="$(github_get_tag_for_version "$githubRepository" "$version")"
if [ -z "$releaseTag" ]; then
printf >&2 '=== [ERROR] Could not find release tag for version "%s" in "%s"!\n' "$version" "$githubRepository"
exit 1
fi
readonly downloadUrl="$(echo -n "$downloadUrlTemplate" | envsubst)"
curl_check_url "$downloadUrl"
readonly binaryPathInArchive="$(echo -n "$binaryPathInArchiveTemplate" | envsubst)"
Expand Down
Loading
Loading