Created
November 3, 2021 16:15
-
-
Save maxjacobson/52caef52ee99b958eba573e485c1db21 to your computer and use it in GitHub Desktop.
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 | |
# frozen_string_literal: true | |
require 'shellwords' | |
require 'logger' | |
logger = Logger.new($stdout) | |
command = ARGV.join(" ") | |
logger.info "Examining #{command.inspect}" | |
fails = 0 | |
runs = 0 | |
10.times do | |
success = system(command) | |
runs += 1 | |
if success | |
logger.info "Passed! So far has failed #{fails} out of #{runs} times" | |
else | |
fails += 1 | |
logger.info "Failed! So far has failed #{fails} out of #{runs} times" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment