Skip to content

Commit

Permalink
fix(tools): trim leading "v" from version
Browse files Browse the repository at this point in the history
  • Loading branch information
WaterLemons2k committed Feb 25, 2024
1 parent c3b7677 commit e2d33c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tools/bump
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh
set -e

VERSION=$1

if [ -z "$VERSION" ]; then
if [ -z "$1" ]; then
echo "Usage: bump <version>"
exit 1
fi

# Trim leading "v"
VERSION=${1#v}

echo "bump $VERSION"

sed -i "4c Version: v$VERSION" README.md
Expand Down
4 changes: 3 additions & 1 deletion tools/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ func main() {
fmt.Println("Usage: go run -C tools . <version>")
return
}
version := os.Args[1]

// If there is a leading "v", remove it as we only need the version number.
version := strings.TrimPrefix(os.Args[1], "v")

url := fmt.Sprintf(
"https://api.github.com/repos/jeessy2/%s/releases/tags/v%s", repo, version,
Expand Down

0 comments on commit e2d33c6

Please sign in to comment.