Implement `execute' action keyword
This commit is contained in:
@@ -12,6 +12,21 @@ module Uh
|
||||
def quit
|
||||
@events.emit :quit
|
||||
end
|
||||
|
||||
def execute command
|
||||
@env.log "Execute: #{command}"
|
||||
pid = fork do
|
||||
fork do
|
||||
Process.setsid
|
||||
begin
|
||||
exec command
|
||||
rescue Errno::ENOENT => e
|
||||
@env.log_error "ExecuteError: #{e}"
|
||||
end
|
||||
end
|
||||
end
|
||||
Process.waitpid pid
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user