forked from github/server
fix preview script so it can checkout and build from tags
This commit is contained in:
parent
5e0c934c6f
commit
6b1285a784
|
@ -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 && \
|
||||
|
|
|
@ -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."
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue