diff --git a/base/.config/profile/profile.d/base.sh b/base/.config/profile/profile.d/base.sh index fc10aad..77288bb 100644 --- a/base/.config/profile/profile.d/base.sh +++ b/base/.config/profile/profile.d/base.sh @@ -76,6 +76,18 @@ github_releases() ( "https://api.github.com/repos/${USER}/${REPO}/releases" ) +github_tags() ( + USER=${1} + REPO=${2-} + if [ -z "${REPO}" ]; then + USER=$(echo "${1}" | sed 's|/| |g' | awk '{print $1}') + REPO=$(echo "${1}" | sed 's|/| |g' | awk '{print $2}') + fi + curl --silent --header "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${USER}/${REPO}/tags" | + jq -r '.[].name' +) + command_installed() ( set -ue cmd=${1}