mirror of https://github.com/shunfei/cronsun
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
500 B
29 lines
500 B
8 years ago
|
#!/bin/sh
|
||
|
|
||
|
function check_code() {
|
||
|
EXCODE=$?
|
||
|
if [ "$EXCODE" != "0" ]; then
|
||
|
echo "build fail."
|
||
|
exit $EXCODE
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
out="dist"
|
||
|
echo "build file to ./$out"
|
||
|
|
||
|
mkdir -p "$out/conf"
|
||
|
|
||
|
go build -o ./$out/node ./bin/node/server.go
|
||
|
check_code
|
||
|
go build -o ./$out/web ./bin/web/server.go
|
||
|
check_code
|
||
|
|
||
|
sources=`find ./conf/files -name "*.json.sample"`
|
||
|
check_code
|
||
|
for source in $sources;do
|
||
|
yes | echo $source|sed "s/.*\/\(\w*\.json\).*/cp -f & .\/$out\/conf\/\1/"|bash
|
||
|
check_code
|
||
|
done
|
||
|
|
||
|
echo "build success."
|