Skip to content

Commit b75a017

Browse files
committed
update build script
1 parent fed8420 commit b75a017

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ if [[ -z "$package" ]]; then
1010
fi
1111
package_split=(${package//\// })
1212
package_name=${package_split[-1]}
13+
# Remove the .go extension from the final package name
14+
final_name=(${package_name//\.go/ })
1315
build_dir='builds'
1416
platforms=("linux/amd64" "windows/amd64" "darwin/amd64")
1517

16-
# Check if the build_dir is empty. If not, ask user if they want to clean it
18+
# Check if the build_dir is empty. If not, ask user if they want to clean it.
1719
if [ -d $build_dir ]; then
1820
read -p "The build directory is not empty. Do you want to clean it? (yes/no): " clean
1921
if [[ $clean == "yes" ]]; then
@@ -29,7 +31,7 @@ do
2931
platform_split=(${platform//\// })
3032
GOOS=${platform_split[0]}
3133
GOARCH=${platform_split[1]}
32-
output_name=$build_dir'/'$package_name'-'$GOOS'-'$GOARCH
34+
output_name=$build_dir'/'$GOOS'-'$GOARCH'/'$final_name
3335
if [ $GOOS = "windows" ]; then
3436
output_name+='.exe'
3537
fi

0 commit comments

Comments
 (0)