Skip to content

Commit e5371d6

Browse files
committed
Bump rsx lib
1 parent 6a45323 commit e5371d6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/rsx.risor

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import os
22
import regexp
33
import exec
44

5+
func log(msg) {
6+
print(msg)
7+
}
8+
9+
func debug(msg) {
10+
if os.getenv("RSX_DEBUG") == "1" {
11+
print('DEBUG: {msg}')
12+
}
13+
}
14+
515
func shell(command) {
616
cmd := exec.command(["bash", "-c", command])
717
buf := buffer()
@@ -14,23 +24,14 @@ func shell(command) {
1424
}, func() { err = true })
1525

1626
if err {
27+
debug(string(buf))
1728
error('error {string(buf)}')
1829
}
1930

2031
return string(buf)
2132
}
2233
func sh(command) { return shell(command) }
2334

24-
func log(msg) {
25-
print(msg)
26-
}
27-
28-
func debug(msg) {
29-
if os.getenv("RSX_DEBUG") == "1" {
30-
print(msg)
31-
}
32-
}
33-
3435
func env(key, def) {
3536
v := os.getenv(key)
3637
if v == "" {

0 commit comments

Comments
 (0)