Last active
May 3, 2018 04:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
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.