Skip to content

Instantly share code, notes, and snippets.

@jelaniwoods
Created April 24, 2019 23:18
Show Gist options
  • Save jelaniwoods/06f06a82c33f45cc183949446ae60885 to your computer and use it in GitHub Desktop.
Save jelaniwoods/06f06a82c33f45cc183949446ae60885 to your computer and use it in GitHub Desktop.
runs = 0
runs_path = ".setup_runs"
if !File.exist?(runs_path)
system! "touch " + runs_path
system! "echo '0' > " + runs_path
runs = open(runs_path).read.to_i
else
runs = open(runs_path).read.to_i
cmd = "echo '#{runs + 1}' > " + runs_path
system! cmd
runs = open(runs_path).read.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment