Skip to content

Instantly share code, notes, and snippets.

@nmcspadden
Created December 8, 2015 00:53
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 nmcspadden/fee3414c07f99d1054be to your computer and use it in GitHub Desktop.
Save nmcspadden/fee3414c07f99d1054be to your computer and use it in GitHub Desktop.
def run(cmd):
'''Runs a command with subprocess, printing output in realtime'''
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
while proc.poll() is None:
l = proc.stdout.readline()
print l,
print proc.stdout.read()
cmd = [
'/Applications/AutoDMG.app/Contents/MacOS/AutoDMG',
'-L', loglevel,
'build', templatepath,
'--download-updates',
'-o', dmg_output_path]
print "Full command: %s" % cmd
run(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment