Skip to content

Instantly share code, notes, and snippets.

@ymek
Created September 7, 2012 22:27
Show Gist options
  • Select an option

  • Save ymek/3670276 to your computer and use it in GitHub Desktop.

Select an option

Save ymek/3670276 to your computer and use it in GitHub Desktop.
def spawn_child(command, wait_for_child = true)
log_status "Spawning #{command}"
child_pid = Process.spawn(command)
if wait_for_child
if (status = Process.wait2(child_pid).last.exitstatus) != 0
log_status("itunes_match_importer exited with code: #{status}", :error)
#exit(1)
else
log_status("#{command} completed")
end
else
Process.detach(child_pid)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment