-
Notifications
You must be signed in to change notification settings - Fork 35
/
.rc
40 lines (30 loc) · 1.01 KB
/
.rc
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
# shellcheck shell=bash
YAMLSCRIPT_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd -P)
[[ :$PATH: == *:"$YAMLSCRIPT_ROOT/install/bin":* ]] ||
PATH=$YAMLSCRIPT_ROOT/install/bin:$PATH
[[ :$LD_LIBRARY_PATH: == *:"$YAMLSCRIPT_ROOT/install/lib":* ]] ||
LD_LIBRARY_PATH=$YAMLSCRIPT_ROOT/install/lib:$PATH
# XXX This goes away after perl binding to libyamlscript is implemented.
[[ :$PATH: == *:"$YAMLSCRIPT_ROOT/perl/bin":* ]] ||
PATH=$YAMLSCRIPT_ROOT/perl/bin:$PATH
[[ :$PYTHONPATH: == *:"$YAMLSCRIPT_ROOT/python/lib":* ]] ||
PYTHONPATH=$YAMLSCRIPT_ROOT/python/lib
export \
LD_LIBRARY_PATH \
PATH \
PYTHONPATH \
YAMLSCRIPT_ROOT \
+ys() (
set -x
make -C $YAMLSCRIPT_ROOT/ys jar
java -jar $YAMLSCRIPT_ROOT/ys/target/uberjar/yamlscript.cli-*-SNAPSHOT-standalone.jar "$@"
)
test-ys-string() (
set -x
python3 -c 'import sys,yamlscript; print(yamlscript.load(sys.argv[1]))' "$@"
)
test-ys-file() (
set -x
python3 -c 'import sys,yamlscript; print(yamlscript.load(open(sys.argv[1])))' "$@"
)
# vim: ft=sh: