Created
September 6, 2012 23:25
-
-
Save JeffAMcGee/3661277 to your computer and use it in GitHub Desktop.
tool to create tar.gz files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import tarfile | |
import sys | |
""" | |
Script to replace tar -czf for turning in CSCE 470 assignments. | |
Author: Jeffrey McGee, based on an idea by John Keech | |
Usage: python tarhw.py hw2 | |
""" | |
def save_tarball(label): | |
with tarfile.open(label+".tar.gz", "w:gz") as tar: | |
tar.add('.git') | |
if __name__=="__main__": | |
label = sys.argv[1] | |
if label: | |
save_tarball(label) | |
else: | |
print "Usage: python tarhw.py hw2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment