]> mj.ucw.cz Git - moe.git/commitdiff
The dir-init function updated to use full paths by default.
authorTomas Gavenciak <gavento@atrey.karlin.mff.cuni.cz>
Wed, 21 May 2008 13:04:12 +0000 (15:04 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 21 May 2008 13:04:12 +0000 (15:04 +0200)
eval/libeval.sh

index 852bca86efbe5176451e231762e40ef5339f4df0..bd3968bbca74a06169f64a599b2231484432ae77 100644 (file)
@@ -111,11 +111,12 @@ function box-clean
 function dir-init
 {
        pstart "Initializing... "
-       HDIR=.
-       PDIR=problems/$PROBLEM
-       SDIR=solutions/$CONTESTANT/$PROBLEM
-       TDIR=testing/$CONTESTANT/$PROBLEM
-       TMPDIR=tmp
+       [ -z "$HDIR" ] && HDIR=`pwd`
+       PDIR=$HDIR/problems/$PROBLEM
+       SDIR=$HDIR/solutions/$CONTESTANT/$PROBLEM
+       TDIR=$HDIR/testing/$CONTESTANT/$PROBLEM
+       TMPDIR=$HDIR/tmp/
+
        [ -d $PDIR ] || die "Problem $PROBLEM not known"
        [ -d $SDIR ] || fatal "Solution of $PROBLEM not found"
        mkdir -p $TDIR $TMPDIR
@@ -124,6 +125,7 @@ function dir-init
        cat >$TDIR/log <<EOF
 Testing solution of $PROBLEM by $CONTESTANT
 Test started at `date`
+Eval base directory: $HDIR
 Contestant's solution directory: $SDIR
 Problem directory: $PDIR
 Testing directory: $TDIR