forked from ControlCore-Project/concore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makestudy
executable file
·46 lines (46 loc) · 1.23 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
46
#!/bin/bash
if [ $# == 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 [ $# = 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"
else
which osascript >/dev/null
if [ $? == 0 ]
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