File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,20 @@ def system_with_output(env, *cmd)
32
32
io_output = IO . try_convert ( output )
33
33
return system ( env , *cmd ) if io_output
34
34
35
- require 'open3'
36
- captured_output , status = Open3 . capture2 ( env , *cmd )
35
+ if RUBY_PLATFORM == 'java'
36
+ # JRuby has issues in dealing with subprocesses (at least up to 1.7.15)
37
+ # @headius told me it's mostly fixed on master, but while we wait for it
38
+ # to ship here's a tempfile workaround.
39
+ require 'tempfile'
40
+ require 'shellwords'
41
+ tempfile = Tempfile . new ( 'opal-node-output' )
42
+ system ( env , cmd . shelljoin +" > #{ tempfile . path } " )
43
+ captured_output = File . read tempfile . path
44
+ tempfile . close
45
+ else
46
+ require 'open3'
47
+ captured_output , status = Open3 . capture2 ( env , *cmd )
48
+ end
37
49
output . write captured_output
38
50
end
39
51
You can’t perform that action at this time.
0 commit comments