-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·37 lines (30 loc) · 901 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#1/bin/bash
if [ -z "$KALDI_ROOT" ]; then
echo "\$KALDI_ROOT must be set prior to running the test (are you in a LaMachine environment with kaldi?)">&2
exit 2
fi
if [ -d resources ]; then
RESOURCEDIR=$(realpath resources)
else
echo "Run this script from the root directory of the forcedalignment2 repository">&2
exit 2
fi
if [ ! -f resources/lexicons/lexicon_from_MARIO.txt ]; then
cd resources
./download_resources.sh || exit 2
cd ..
fi
WEBSERVICEDIR=$(realpath forcedalignment2)
WORKDIR=$(mktemp -d)
if [ -z "$WORKDIR" ]; then
echo "Unable to create workdir">&2
exit 2
fi
mkdir $WORKDIR/input
cp resources/data/test/* $WORKDIR/input/
mkdir $WORKDIR/output
mkdir $WORKDIR/scratch
$WEBSERVICEDIR/wrapper.sh $WORKDIR/input $WORKDIR/scratch $RESOURCEDIR $WORKDIR/output $WEBSERVICEDIR $WORKDIR/status.log
r=$?
echo "(all output is in $WORKDIR)">&2
exit $r