mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 17:22:35 +00:00
Don't use 'IO.popen' when no block is given, use 'system' instead.
This commit is contained in:
@@ -81,15 +81,17 @@ class W3DHub
|
||||
|
||||
status.zero?
|
||||
else
|
||||
IO.popen(command) do |io|
|
||||
if block
|
||||
if block
|
||||
IO.popen(command, "r") do |io|
|
||||
io.each_line do |line|
|
||||
block&.call(line)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
$CHILD_STATUS.success?
|
||||
$CHILD_STATUS.success?
|
||||
else
|
||||
system(command)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user