1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #!/bin/bash
- # 服务器使用的导出脚本
- cd `dirname $0`
- curdir=$(cd `dirname $0`;pwd)
- source ../bin/functions.sh
- start_time=$(date +%s)
- #echo "cur system "$OSTYPE
- if [[ "$OSTYPE" == "msys"* ]]; then
- echo "WINDOWS"
- exporter=../bin/exporter.exe
- elif [[ "$OSTYPE" == "darwin"* ]]; then
- echo "MAC"
- exporter=../bin/exporter
- chmod 777 $exporter
- else
- echo "config not support system "$OSTYPE
- exit
- fi
- ret=0
- function ExportText() {
- $exporter -skip-check=true $* &
- if [ "$?" != "0" ]; then
- ret=1
- fi
- }
- function CheckRet() {
- if [ "$?" != "0" ]; then
- ret=1
- fi
- }
- datadir=./TestServer/Data
- codedir=./TestServer/Parser
- #echo "===export tuo la==="
- datafmt=fmt/json.data.tpl
- gosheetfmt=fmt/json.go.sheet.tpl
- gotypefmt=fmt/json.go.type.tpl
- component=fmt/json.go.all.tpl
- #files="GlobalConfig.xlsx UIConfig.xlsx"
- $exporter -t=TypeDefine -tags=v,s, -outs='[
- {"Form":"json","Out":"'$datadir'","Tpl":"'$datafmt'","AllInOne":false,"Tags":",s","Ext":".json"},
- {"Form":"raw","Out":"'$codedir'","Tpl":"'$component'","AllInOne":true,"Ext":"component.go"},
- {"Form":"raw","Out":"'$codedir'","Tpl":"'$gosheetfmt'","TypeTpl":"'$gotypefmt'","Ext":".go","TypeAligns":"int32:int","TypeAlignTpl":"go"}
- ]' ./LogicConfig/lua_*.xlsx
- CheckRet
- wait
- end_time=$(date +%s)
- cost_time=$[ $end_time-$start_time ]
- echo "use time: $(($cost_time/60))min $(($cost_time%60))s"
- if [ "$ret" = "0" ]; then
- #CountDownExit 2
- echo "complete!"
- sleep 1
- else
- echo "******************parse error occured****************"
- Pause 'Press any key to continue...'
- sleep 0.5
- fi
- #Pause 'Press any key to continue...'
|