Skip to content

Commit

Permalink
add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
yqiangsap committed Jul 1, 2020
1 parent 80eb3a8 commit 2389333
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
/example_logs/
/jog.log
/.vscode
/target
21 changes: 21 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

PROJECT_DIR=$(cd "$(dirname $0)";pwd)
TARGET_DIR=${PROJECT_DIR}/target

rm -rf ${TARGET_DIR}
cd ${PROJECT_DIR}

go_build() {
local _OS=$1
local _OS_TARGET_DIR=${TARGET_DIR}/${_OS}

mkdir -p ${_OS_TARGET_DIR}
GOOS=${_OS} GOARCH=amd64 go build -o ${_OS_TARGET_DIR}/jog
}

go_build linux
go_build darwin
go_build windows

0 comments on commit 2389333

Please sign in to comment.