Skip to content

Commit

Permalink
Add build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnreutersward committed Jan 15, 2021
1 parent 4ba7b81 commit 9d4261e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

APP=qrcli
ARCH=amd64

# Set version
read -p "Version: " VERSION

# Build for macOS
GOOS=darwin GOARCH=$ARCH go build
zip $APP-$VERSION-darwin-$ARCH.zip $APP

# Build for Linux
GOOS=linux GOARCH=$ARCH go build
zip $APP-$VERSION-linux-$ARCH.zip $APP

# Build for Windows
GOOS=windows GOARCH=$ARCH go build
zip $APP-$VERSION-windows-$ARCH.zip $APP.exe

# Clean up
rm $APP
rm $APP.exe
2 changes: 1 addition & 1 deletion qrcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func printUsage() {
}

func printVersion() {
fmt.Fprintf(os.Stdout, "qrcli %s\n", version)
fmt.Fprintf(os.Stdout, "qrcli v%s\n", version)
os.Exit(0)
}

Expand Down

0 comments on commit 9d4261e

Please sign in to comment.