forked from GetAnsa/rascalWrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrascal
More file actions
executable file
·47 lines (31 loc) · 805 Bytes
/
rascal
File metadata and controls
executable file
·47 lines (31 loc) · 805 Bytes
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
#!/bin/bash
execDir="$(dirname $0)"
source $execDir/commonPrefix
fileFound=""
if [[ -f $1 ]]
then
fileFound="$1"
fi
if [[ -f "${1}.rsc" ]]
then
fileFound="${1}.rsc"
fi
if [[ ! -z "$fileFound" ]]
then
module=`head -n 1 $fileFound | sed 's/module *//'`
if [[ -z $module ]]
then
echo "no module declared in source file"
exit 1
fi
tmpDir=`mktemp -d`
mkdir $tmpDir/META-INF
echo "Project-Name: convenientRascal" > $tmpDir/META-INF/RASCAL.MF
echo "Source: src/$module/rascal" >> $tmpDir/META-INF/RASCAL.MF
mkdir -p $tmpDir/src/$module/rascal
cp $fileFound $tmpDir/src/$module/rascal/
cd $tmpDir
/opt/homebrew/opt/openjdk/bin/java -jar ~/.rascal/rascal-*.jar $fileFound ${@:2}
exit 0
fi
/opt/homebrew/opt/openjdk/bin/java -jar ~/.rascal/rascal-*.jar $@