summaryrefslogtreecommitdiffstats
path: root/controller/commit_results
blob: f18a361d89b0c3005fdac8fc2006be57c6f26216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

srcdir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) || exit 1
. "$srcdir/config/config.sh" || {
    echo >&2 "sorry, but $srcdir/config/config.sh not found"
    exit 1
}

# argparse
resultdir="$1"
ressubdir="$2"
test -n "$ressubdir" || { "no path specified" ; exit 1 ; }
test -n "$3" && DTF_DATABASE="$2"

# checks
test -z "$DTF_DATABASE" && exit 1
test -f "$resultdir/dtf.tar.gz" || exit 1

# run
if test ! -d "$DTF_DATABASE/$ressubdir"; then
    mkdir -p "$DTF_DATABASE/$ressubdir"
fi

( cd "$resultdir" && tar -xf dtf.tar.gz && cp -r dtf "$DTF_DATABASE/$ressubdir" )