Skip to content

Instantly share code, notes, and snippets.

@simianhacker
Created April 8, 2009 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save simianhacker/91636 to your computer and use it in GitHub Desktop.
Save simianhacker/91636 to your computer and use it in GitHub Desktop.
--[[
VPLanguage = lua
VPScriptMenuTitle = GitHub Commit
VPEndConfig
]]
-- we assume git is located in /opt/local/bin/git
posix.chdir(document:fileName())
-- add new files
os.execute("/opt/local/bin/git add -A")
-- clean up deleted pages
os.execute("/opt/local/bin/git rm `/opt/local/bin/git status | /usr/bin/grep 'deleted:' | /usr/bin/sed -e 's/.*deleted:[ ]*//g'`")
os.execute("/opt/local/bin/git commit -a -m 'auto commit'")
os.execute("/opt/local/bin/git push")
os.execute("/opt/local/bin/git status")
vpconsole("Commit complete.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment