From 6b1285a784772616937e525529b58661b3999880 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 1 Feb 2015 08:21:07 +0100 Subject: [PATCH] fix preview script so it can checkout and build from tags --- s/cron/previews.sh | 9 ++++++++- s/preview | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/s/cron/previews.sh b/s/cron/previews.sh index 6e30c75c5..64c299627 100755 --- a/s/cron/previews.sh +++ b/s/cron/previews.sh @@ -1,11 +1,18 @@ #!/bin/sh + +function abort() { +echo $1 +[ -z $2 ] && exit -1 +exit $2 # otherwise +} + [ -z ${ERESSEA} ] && ERESSEA=~/eressea branch="master" if [ -e ${ERESSEA}/build/.preview ]; then branch=`cat ${ERESSEA}/build/.preview` fi SRC=${ERESSEA}/git -${SRC}/s/preview build ${branch} +${SRC}/s/preview build ${branch} || abort "failed to build ${branch}" ${SRC}/s/preview version for game in 2 3 4 ; do ${SRC}/s/preview -g ${game} run && \ diff --git a/s/preview b/s/preview index 99414fafd..12752738f 100755 --- a/s/preview +++ b/s/preview @@ -22,8 +22,9 @@ exit $2 # otherwise function build() { assert_dir $SOURCE cd $SOURCE +git fetch || abort "failed to update source. do you have local changes?" [ -z $1 ] || git checkout $1 -( git pull && git submodule update ) || abort "failed to update source. do you have local changes?" +git submodule update s/build || abort "build failed." }