-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmakestudy
executable file
·45 lines (40 loc) · 1.3 KB
/
makestudy
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
#!/usr/bin/env bash
if [ "$#" -eq 0 ]; then
echo "Make a concore study"
echo " ./makestudy path/name.graphml"
echo " ./makestudy path/name.graphml study"
echo "In the first case, the name of the study is the same as the name of the .graphml"
echo "In either case, source files come from the same path as the .graphml"
echo "The equivalent mkconcore.py is displayed"
exit
fi
graphml="$1"
if [ -e "$graphml" ]; then
sourcedir="$(dirname "$graphml")"
else
graphml="${graphml}.graphml"
if [ -e "$graphml" ]; then
sourcedir="$(dirname "$graphml")"
else
echo "$graphml does not exist"
exit
fi
fi
if [ "$#" -eq 1 ]; then
studydir="$(basename "${graphml%.*}")"
else
studydir="$2"
fi
if [ -e "$studydir" ]; then
echo "Cannot make $studydir because one already exists with that name"
echo "Either do ./destroy $studydir, or choose a unique name as 2nd arg"
exit
else
if command -v osascript >/dev/null; then
echo "python3 mkconcore.py \"$graphml\" \"$sourcedir\" \"$studydir\" macos"
python3 mkconcore.py "$graphml" "$sourcedir" "$studydir" macos
else
echo "python3 mkconcore.py \"$graphml\" \"$sourcedir\" \"$studydir\" ubuntu"
python3 mkconcore.py "$graphml" "$sourcedir" "$studydir" ubuntu
fi
fi