-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·42 lines (34 loc) · 1.09 KB
/
entrypoint.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
38
39
40
41
42
#!/bin/bash
pwd
failedfile="${PWD}/failed"
repo="$1"
if [ "sistem_pokljuskega_grebena" == "$repo" ]; then
_svxFiles=*/svx/*.svx
_3dFiles=*/svx/*.3d
elif [ "kanin_rombon" == "$repo" ]; then
surveysDir="surveys"
_svxFiles=${surveysDir}/*/*.svx
_3dFiles=${surveysDir}/*/*.3d
elif [ "planina_poljana" == "$repo" ]; then
surveysDir="surveys"
_svxFiles=${surveysDir}/*/*.svx
_3dFiles=${surveysDir}/*/*.3d
else
echo "Unknown repo $repo"
exit 1
fi
ls *.svx $_svxFiles | xargs -I{ bash -c "echo \"{\"; cd \"\$(dirname {)\"; cavern \"\$(basename {)\" || echo \"{\" >> \"$failedfile\"" >> cavern.log
if [ -f "$failedfile" ]; then
echo "One or more conversions failed!"
cat "$failedfile"
echo "cavern.log"
cat cavern.log
exit 1
fi
for entity in *.3d $_3dFiles; do
md5=$(dump3d "$entity" | grep -vE '^DATE\ "' | grep -vE '^DATE_NUMERIC\ ' | md5sum | awk '{print $1}')
echo "${entity},${md5}" >> "hashes.csv"
/surv/usr/bin/survexport --legs --gpx "$entity" "${entity%.3d}".gpx |& tee /tmp/out
test -s /tmp/out && exit 1
done
zip -r artifact.zip *