Skip to content

Instantly share code, notes, and snippets.

@roidrage
Last active May 3, 2018 04:46
Show Gist options
  • Save roidrage/5238585 to your computer and use it in GitHub Desktop.
Save roidrage/5238585 to your computer and use it in GitHub Desktop.
A simple wrapper that forks off a child and prints out a progress dot every X seconds
#!/usr/bin/env ruby
pid = Kernel.fork do
`#{ARGV.join(" ")}`
exit
end
trap(:CHLD) do
print "\n"
exit
end
loop do
sleep 10
begin
Process.kill(0, pid)
print '.'
rescue Errno::ESRCH
print "\n"
exit 0
end
end
@roidrage
Copy link
Author

This helps to run command on Travis that are slightly longer but that themselves create too little output so that the process may hit the timeout, or that generate too much progress output to clutter the logs.

@s-sajid-ali
Copy link

Could you give more info as to how one would use the above ? Where does one specify the command to build a package in the above ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment