forked from oils-for-unix/oils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·60 lines (45 loc) · 913 Bytes
/
run.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
#
# Usage:
# client/run.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
source build/dev-shell.sh # python3
source devtools/run-task.sh
py-demo() {
echo mystdin | client/headless_demo.py --sh-binary bin/osh
}
cpp-demo() {
local bin=_bin/cxx-dbg/osh
ninja $bin
echo mystdin | client/headless_demo.py --sh-binary $bin
}
errors() {
set +o errexit
# Invalid netstring
client/headless_demo.py 'zzz'
echo status=$? # TODO: assert status
# Invalid command
client/headless_demo.py '3:foo,'
echo status=$?
# Command doesn't have file descriptors
client/headless_demo.py '4:ECMD,'
echo status=$?
}
# Hm what is this suppose to do? It waits for input
demo-pty() {
echo mystdin | client/headless_demo.py --to-new-pty
}
soil-run-py() {
py-demo
echo
errors
echo
}
soil-run-cpp() {
which python3
echo
cpp-demo
}
run-task "$@"