-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv
executable file
·35 lines (31 loc) · 1.39 KB
/
env
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
#!/bin/bash
# environment variables (source it from your .bashrc?)
function getpath() {
[ -e "$*" ] || { echo "path '$*' doesn't exist!" >&2; exit 1; }
readlink -f "$*"
}
if ! [ -d "$skalchdir" ]; then
if [ -z "$0" ]; then
echo "ERROR -- if you are running this from bash, run
export skalchdir=<YOUR_PATH_TO_SKALCH_SANDBOX"
else
export skalchdir="$(dirname "$(getpath "$0")")"
fi
fi
export grgenfiles="$skalchdir"/plugin/src/main/grgen
export angelicsimple="$skalchdir"/base/src/test/scala/angelic/simple
export sugaredtest=$angelicsimple/SugaredTest.scala.ast.gxl
export rewritetemplates="$skalchdir"/base/src/main/scala/skalch/RewriteTemplates.scala.ast.gxl
export libgrg="$(getpath "$skalchdir"/../grgen/engine-net-2/bin)"
export stagetf="$(getpath "$skalchdir"/../grgen/engine-net-2/FSharpBindings)"
stagetf_sources_array=($(for i in $(cat "$stagetf"/filelist); do echo "$stagetf"/"$i"; done))
export stagetf_sources="${stagetf_sources_array}"
export MONO_PATH="$libgrg:$HOME/bin/fsharp/bin"
function g() { grep -E "$@" $(find . -iregex ".*\\.\\(grg\\|gm\\|fs\\)" | sed '/\/gen\//d'); }
function tf() {
mono "$grgenfiles"/transformer.exe "$@"
}
function tf-test() { tf --goal sketch $sugaredtest --export "$angelicsimple/SugaredTest.sketch.ast.gxl" "$@"; }
if ! [ -d "$libgrg" ]; then
echo "ERROR -- '$libgrg' doesn't exist! Please check out GrGen!" >&2; exit 1
fi