Created
January 9, 2023 15:18
-
-
Save LevitatingBusinessMan/ca6143104f962013cdad3cff215584e5 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 | |
FILENAME = ARGV[0] | |
abort "No filename given" if !FILENAME | |
clog = "" | |
STARTTIME = Time.now | |
File.write FILENAME, `date`, mode: 'a' | |
loop do | |
print "> " | |
line = STDIN.gets | |
break if !line or line == "end\n" | |
clog += line | |
# End clog | |
if line == "\n" | |
time_since = (Time.now - STARTTIME).to_i / 60 | |
File.write FILENAME, "T+#{time_since}: #{clog}", mode: 'a' | |
puts "Saved" | |
clog = "" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment