Skip to content

Instantly share code, notes, and snippets.

@antillean
Created April 5, 2015 11:38
Show Gist options
  • Save antillean/7bb75d64cefa021a2fdc to your computer and use it in GitHub Desktop.
Save antillean/7bb75d64cefa021a2fdc to your computer and use it in GitHub Desktop.
Adds and commits all files, printing the output of each command. The noteworthy thing here is the second command, which has to be executed as an array rather than a String.
#!/usr/bin/env groovy
def process = "git add .".execute()
println process.text
// This next one has to be done as an array because of the space in the -am argument.
process = ["git", "commit", "-am 'First commit'"].execute()
println process.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment