-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·52 lines (38 loc) · 1.45 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# export GOPATH=/Users/chandan/GOPATH
# export GOBIN=$GOPATH/bin
# export $PATH=$GOBIN:$PATH
swagger validate api_spec.yaml
if [ $? -eq 0 ]
then
if [ "$1" = "clean" ]
then
echo "Deleting direcotries..."
rm -rf cmd restapi models
fi
swagger generate server -A hspc -P models.Principal -f api_spec.yaml
#go get -u -f ./...
fi
#sed -n s/"api.ServerShutdown = func() {}"/"requesthandler.Override_configure_hspc(api); api.ServerShutdown = func() {}"/1 restapi/configure_hspc.go #&2 > restapi/configure_hspc.go
#$LINE=`grep -n -F 'api.ServerShutdown = func() {}' restapi/configure_hspc.go | cut -d':' -f1`
#sed '/api.ServerShutdown = func() {}/i\requesthandler.Override_configure_hspc(api)\' restapi/configure_hspc.go
#grep -n -F 'api.ServerShutdown = func() {}' restapi/configure_hspc.go | cut -d':' -f1 | sed $line' a \requesthandler.Override_configure_hspc(api)' < restapi/configure_hspc.go
# add our code hook
#sed -i '' '
#/github\.com\/chandanchowdhury\/HSPC\/models/ i\
#\"github.com/chandanchowdhury/HSPC/requesthandler\"' restapi/configure_hspc.go
#
#sed -i '' '
#/api.ServerShutdown = func() {}/ i\
#\requesthandler.Override_configure_hspc(api)' restapi/configure_hspc.go
#
#gofmt -w restapi/configure_hspc.go
# reformat code
go fmt ./dbhandler
go fmt ./requesthandler
go fmt ./restapi
# Check code for suspecious constructs
go tool vet ./dbhandler
go tool vet ./requesthandler
go tool vet ./restapi
go tool vet ./models