Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
Add version for build script
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzzymiglet committed Feb 16, 2020
1 parent e7b663b commit 526e4ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/usr/bin/env bash

package=$1
version=$2
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
echo "usage: $0 <package-name> <version>"
exit 1
fi
if [[ -z "$version" ]]; then
echo "usage: $0 <package-name> <version>"
exit 1
fi

package_split=(${package//\// })
package_name=${package_split[-1]}

Expand All @@ -15,7 +21,7 @@ do
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}
output_name=$package_name'-'$GOOS'-'$GOARCH
output_name=$package_name'-'$version'-'$GOOS'-'$GOARCH
if [ $GOOS = "windows" ]; then
output_name+='.exe'
fi
Expand Down

0 comments on commit 526e4ec

Please sign in to comment.