lib/fusuma/plugin/executors/command_executor.rb in fusuma-1.11.1 vs lib/fusuma/plugin/executors/command_executor.rb in fusuma-2.0.0.pre

- old
+ new

@@ -1,7 +1,8 @@ # frozen_string_literal: true +require 'posix/spawn' require_relative './executor.rb' module Fusuma module Plugin module Executors @@ -10,14 +11,11 @@ def execute(event) search_command(event).tap do |command| break unless command MultiLogger.info(command: command) - pid = fork do - Process.daemon(true) - exec(command.to_s) - end + pid = POSIX::Spawn.spawn(command.to_s) Process.detach(pid) end end def executable?(event)