-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_featureModels.sh
executable file
·49 lines (45 loc) · 1.33 KB
/
init_featureModels.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
43
44
45
46
47
48
49
# Extract all Feature Models to examples/FeatureModels
echo "----Starting workspace preparation for evaluation----"
echo "[INFO] Extracting raw feature models..."
mkdir -p ./examples/rawFMs
pushd ./examples/rawFMs >/dev/null
unzip -q ../featureModels.zip
cp -r ./FeatureModels/* .
rm -rf FeatureModels/
# model is broken / void
rm -rf WaterlooGenerated/
popd >/dev/null
echo "[INFO] Done!"
echo "[INFO] Preparing feature models..."
pushd ./examples/rawFMs >/dev/null
returnCode=0
for D in *; do
if [ -d "${D}" ]; then
pushd "./${D}" >/dev/null
## ,, is to lower case
if [ "${D,,}" = "velvet" ]; then
mv ./HelloWorldMPL-VELVET/model.xml .
fi
# remove all files expect files ending with model.xml
find . -type f -not -name 'model.xml' -delete
# remove all dirs
find . -type d -exec rm -rf {} + 2>/dev/null
mv 'model.xml' "${D}.xml" 2>/dev/null
returnCode=$?
if [ $returnCode -ne 0 ]; then
echo "[WARN] Could not find model.xml in folder ${D}"
fi
popd >/dev/null
fi
done
popd >/dev/null
echo "[INFO] Done!"
echo "[INFO] Moving into ddueruem workspace..."
rm -rf evaluation/ >/dev/null
mkdir evaluation
cp -r ./examples/rawFMs/* evaluation/
echo "[INFO] Done!"
echo "[INFO] Removing raw data..."
rm -rf ./examples/rawFMs
echo "[INFO] Done!"
echo "----Workspace is prepared for evaluation!----"