-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateFolders.sh
More file actions
56 lines (48 loc) · 1.35 KB
/
Copy pathcreateFolders.sh
File metadata and controls
56 lines (48 loc) · 1.35 KB
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
50
51
52
53
54
55
56
# This part is evaluating the given arguments
inputDir="../x_in_corpus_javascript"
nrTestRuns=1;
cpuCoresString="";
cpuCores=(0);
cpuCoresList=(0);
while getopts 'n:i:' opt; do
case "$opt" in
n)
if [ -z $OPTARG ]
then
echo "Please do not provide an empty number of testruns.";
else
nrTestRuns=$OPTARG;
echo The script will generate folders for $nrTestRuns test runs for each SUT.;
fi
;;
i)
if [ -z $OPTARG ]
then
echo "Please do not provide an empty location of the snippets.";
else
inputDir=$OPTARG;
echo The script will use the snippets inside the direction $inputDir and copy them into the \"in\" folders.;
fi
;;
esac
done
# The next part reads in the folders and sub-folders
shopt -s nullglob
directories=(*/)
# The next part creates the folders for each instance
for dir in "${directories[@]}"
do
curdir=$(pwd);
# echo pwd is "$curdir"/"$inputDir/*";
rm -r "$dir""00_vorlage/in";
mkdir "$dir""00_vorlage/out";
cp -r "$inputDir" "$dir""00_vorlage/in";
# cd "$dir""00_vorlage/in";
# ls;
# cd ../../../;
for ((run = 1; run <= $nrTestRuns; run++))
do
mv "$dir""$run" "$dir""$run""_old"
cp -r "$dir""00_vorlage" "$dir""$run"
done
done