Created
June 8, 2017 01:37
-
-
Save b-coimbra/0deb7976d647b1a08eb5d230aec539f2 to your computer and use it in GitHub Desktop.
daily commit script
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 | |
# encoding: UTF-8 | |
cmds = <<CMDS | |
git add file.txt | |
git commit -m "update" | |
git push -u origin master | |
CMDS | |
cmds.each_line(&(c=[]).method(:<<)) | |
test(?e, '.git') ? ->(*cmds) {cmds.map(&method(:system)); sleep(1)}.(c.to_s) : \ | |
(File.open('file.txt', 'w'){|f| f << '( ͡° ͜ʖ ͡°)'} && (`git init`;`git remote add origin <repository-name>.git`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment