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
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
restore-keys: |
${{ runner.os }}-prebuild-
- run: ./gimme module | grep ^export | tee -a "${GITHUB_ENV}"
- uses: actions/setup-go@v5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels moderately ironic, given the purpose of this repository/tool 😂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It amused me too. 😆

with:
go-version: 'stable'
- run: make gimme-generate
- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -84,6 +87,9 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.env.target }}-${{ matrix.env.version }}-test-
${{ runner.os }}-${{ matrix.env.target }}-
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- uses: actions/download-artifact@v3
with:
name: gimme-generate-${{ runner.os }}
Expand Down
10 changes: 5 additions & 5 deletions .testdata/sample-versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#

1.19.3
1.18.8
1.17.13
1.16.15
1.15.15
1.23.3
1.22.9
1.21.13
1.20.14
1.19.13
8 changes: 4 additions & 4 deletions gimme
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ set -o pipefail

[[ ${GIMME_DEBUG} ]] && set -x

readonly GIMME_VERSION="v1.8.0"
readonly GIMME_VERSION="v1.8.1"
readonly GIMME_COPYRIGHT="Copyright (c) 2022 gimme contributors"
readonly GIMME_LICENSE_URL="https://raw.githubusercontent.com/urfave/gimme/${GIMME_VERSION}/LICENSE"
export GIMME_VERSION
Expand Down Expand Up @@ -523,13 +523,13 @@ _list_versions() {
local current_version
current_version="$(go env GOROOT 2>/dev/null)"
current_version="${current_version##*/go}"
current_version="${current_version%%.${GIMME_OS}.*}"
current_version="${current_version%%."${GIMME_OS}".*}"

# 1.1 1.10 1.2 is bad; zsh has `setopt numeric_glob_sort` but bash
# doesn't appear to have anything like that.
for d in "${GIMME_VERSION_PREFIX}/go"*".${GIMME_OS}."*; do
local cleaned="${d##*/go}"
cleaned="${cleaned%%.${GIMME_OS}.*}"
cleaned="${cleaned%%."${GIMME_OS}".*}"
echo "${cleaned}"
done | _version_sort | while read -r cleaned; do
echo -en "${cleaned}"
Expand Down Expand Up @@ -652,7 +652,7 @@ _get_curr_stable() {
_update_stable "${stable}"
fi

cat "${stable}"
head -n 1 "${stable}"
}

_get_old_stable() {
Expand Down