Skip to content

Commit ca5052e

Browse files
committed
Use OS detection
1 parent 5e08668 commit ca5052e

7 files changed

+30
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Golang and Node MAY use network to download dependencies.
6161

6262
Common steps are:
6363

64-
# go build ./cmd/golden
64+
# ./scripts/make-build-${OSTYPE}.sh
6565
# ./golden --debug
6666

6767
That's all.

scripts/make-build-darwin.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ echo "Arch: ${GOARCH}"
1313
# Step 1. Get Go modules
1414
#
1515
echo "==> Step 1. Get Go modules..."
16-
go get -v ./...
16+
go get -v ../...
1717

1818
# Step 2. Generate assets
1919
#
@@ -23,9 +23,9 @@ go generate
2323
# Step 3. Run unittest
2424
#
2525
echo "==> Step 3. Run unittest..."
26-
go test ./...
26+
go test ../...
2727

2828
# Step 4. Compile executable
2929
#
3030
echo "==> Step 4. Compile executable..."
31-
go build -o golden-${GOOS}-${GOARCH} ./cmd/golden
31+
go build -o ../golden-${GOOS}-${GOARCH} ../cmd/golden
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
#!/bin/bash
22

3+
SCRIPT_DIR="$(readlink -f $(dirname "$0"))"
4+
SRC_DIR="$(dirname "${SCRIPT_DIR}")"
5+
36
echo "=== Golden Point Compile Script ==="
47

58
# Step 0. Prepare environemnt
69
export GOOS="linux"
710
export GOARCH="amd64"
811
export CGO_ENABLED="1"
912
#
10-
echo "OS: ${GOOS}"
13+
echo " Src: ${SRC_DIR}"
14+
echo " OS: ${GOOS}"
1115
echo "Arch: ${GOARCH}"
1216

1317
# Step 1. Get Go modules
1418
#
1519
echo "==> Step 1. Get Go modules..."
16-
go get -v ./...
20+
go get -v ${SRC_DIR}/...
1721

1822
# Step 2. Generate assets
1923
#
@@ -23,9 +27,9 @@ go generate
2327
# Step 3. Run unittest
2428
#
2529
echo "==> Step 3. Run unittest..."
26-
go test ./...
30+
go test ${SRC_DIR}/...
2731

2832
# Step 4. Compile executable
2933
#
3034
echo "==> Step 4. Compile executable..."
31-
go build -o golden-${GOOS}-${GOARCH} ./cmd/golden
35+
go build -o ${SRC_DIR}/golden-${GOOS}-${GOARCH} ${SRC_DIR}/cmd/golden

scripts/make-report-cyclo.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
4+
5+
~/go/bin/gocyclo ..
6+

scripts/make-report-fmt.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
go fmt ../...

scripts/make-report-ineffassign.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
go install github.com/gordonklaus/ineffassign@latest
4+
5+
~/go/bin/ineffassign ../...
6+

scripts/make-report-vet.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
go vet ../...

0 commit comments

Comments
 (0)