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.
cronsun/build.sh

29 lines
507 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"
8 years ago
go build -o ./$out/cronnode ./bin/node/server.go
8 years ago
check_code
8 years ago
go build -o ./$out/cronweb ./bin/web/server.go
8 years ago
check_code
sources=`find ./conf/files -name "*.json.sample"`
check_code
for source in $sources;do
8 years ago
yes | echo $source|sed "s/.*\/\(.*\.json\).*/cp -f & .\/$out\/conf\/\1/"|bash
8 years ago
check_code
done
echo "build success."