-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrun.sh
executable file
·47 lines (40 loc) · 1.24 KB
/
run.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
#!/bin/bash
# Go Path
# CURDIR=`pwd`
# OLDGOPATH="$GOPATH"
# export GOPATH="$CURDIR/../../"
LogPrefix=">>>>"
# 更新Bindata
while getopts "ath" arg
do
case $arg in
h)
echo "- [h] [a] [t] help"
echo "-h [a] help"
echo "-a update assets bindata"
echo "-t update template bindata"
exit
;;
a)
echo -e "$LogPrefix `date +"%H:%M:%S"` [\033[44;37m update \033[0m] assets bindata"
go-bindata -ignore=\\.DS_Store -debug -ignore=assets.go -pkg="assets" -o assets/assets.go assets/...
;;
t)
echo -e "$LogPrefix `date +"%H:%M:%S"` [\033[44;37m update \033[0m] template bindata"
go-bindata -ignore=\\.DS_Store -debug -ignore=template.go -pkg="template" -o template/template.go template/...
;;
?) #当有不认识的选项的时候arg为?
echo "unknown argument"
echo "-h [a] help"
exit 1
;;
esac
done
# 清空pkg
echo -e "$LogPrefix `date +"%H:%M:%S"` remove pkg"
rm -rf pkg/*
echo -e "$LogPrefix `date +"%H:%M:%S"` [\033[42;37m run \033[0m] server"
# 使用默认配置
go run echo.go
# 指定配置文件
# go run echo.go -c conf/conf.toml