Skip to content

Commit 7ba6ee2

Browse files
committed
Avoid assuming POSIX shell semantics
The || operator is not available on all shells, e.g. not with nushell. Fixes #15
1 parent 36e55a0 commit 7ba6ee2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

autoload/lumen/debug.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let s:stderr = []
33
func lumen#debug#info()
44
let job_state = lumen#job_state()
55
let platform = lumen#platforms#platform()
6-
return {'platform': platform, 'job_state': job_state, 'job_errors': s:stderr}
6+
return {'platform': platform, 'job_state': job_state, 'job_errors': s:stderr, 'shell': &shell}
77
endfunc
88

99
func lumen#debug#log_err(line)

autoload/lumen/platforms/macos.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ func lumen#platforms#macos#parse_line(line)
1313
endfunc
1414

1515
func lumen#platforms#macos#oneshot()
16-
silent let out = get(systemlist(printf("%s get || swiftc %s.swift -o %s", s:exe, s:exe, s:exe)), 0)
16+
silent let out = get(systemlist(printf("%s get", s:exe)), 0)
1717
if len(out) != 5
1818
let err = out
19+
silent let compile = system(printf("swiftc %s.swift -o %s", s:exe, s:exe))
1920
" fallback
2021
silent let out = get(systemlist(s:exe . ".swift get"), 0)
2122
endif
@@ -24,6 +25,7 @@ func lumen#platforms#macos#oneshot()
2425
call lumen#platforms#macos#parse_line(out)
2526
else
2627
call lumen#debug#log_err(err)
28+
call lumen#debug#log_err(compile)
2729
call lumen#debug#log_err(out)
2830
endif
2931
endfunc

autoload/lumen/platforms/macos/watcher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import Cocoa
66
import Darwin
77

8-
setbuf(stdout, nil); // don't buffer the output. thats why print() didn't work.
8+
setbuf(stdout, nil); // don't buffer the output
99

1010
var isAppearanceDark: Bool {
1111
if #available(macOS 11.0, *) {

0 commit comments

Comments
 (0)