Skip to content

Instantly share code, notes, and snippets.

@b-coimbra
Created June 8, 2017 01:37
Show Gist options
  • Save b-coimbra/0deb7976d647b1a08eb5d230aec539f2 to your computer and use it in GitHub Desktop.
Save b-coimbra/0deb7976d647b1a08eb5d230aec539f2 to your computer and use it in GitHub Desktop.
daily commit script
#!/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