Skip to content

Instantly share code, notes, and snippets.

@joelewis
Created May 25, 2013 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelewis/5650626 to your computer and use it in GitHub Desktop.
Save joelewis/5650626 to your computer and use it in GitHub Desktop.
python script to do all the commandline works for me after writing a blog post.
from subprocess import call
import sys
def main():
if len(sys.argv) == 2:
call('gist ' + sys.argv[1], shell=True)
call('python /home/joe/Documents/workstage/joelewis/blog/utils/addone.py', shell=True)
call('git --git-dir=/home/joe/Documents/workstage/joelewis/.git --work-tree=/home/joe/Documents/workstage/joelewis add .',shell=True)
call('git --git-dir=/home/joe/Documents/workstage/joelewis/.git --work-tree=/home/joe/Documents/workstage/joelewis commit -m "+1 post"',shell=True)
call('git --git-dir=/home/joe/Documents/workstage/joelewis/.git --work-tree=/home/joe/Documents/workstage/joelewis push heroku master', shell=True)
else:
print "enter valid filename"
if __name__ =='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment