Skip to content

Commit

Permalink
normalize_go_version
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Aug 10, 2023
1 parent 256fc27 commit 7abf2ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ select_remote_version() {
echo "$versions" | ./src/"semver-select" --go -c "$constraint" -n 1 -i -
}

# uses semver-select to convert a go version to semver
# go1.2rc3 -> 1.2.0-rc3
# 1.2.3rc3 -> 1.2.3-rc3
normalize_go_version() {
./src/"semver-select" --go -c '*.0' "$1"
}

select_go_version_from_file() {
local go_file_path="$1"

Expand All @@ -189,5 +196,5 @@ select_go_version_from_file() {
found_version="1.16"
fi

echo "$found_version"
normalize_go_version "$found_version"
}

0 comments on commit 7abf2ab

Please sign in to comment.