Skip to content

Instantly share code, notes, and snippets.

@whitmo
Last active August 29, 2015 14:13
Show Gist options
  • Save whitmo/4e274c1fafc71f1ca509 to your computer and use it in GitHub Desktop.
Save whitmo/4e274c1fafc71f1ca509 to your computer and use it in GitHub Desktop.
def overwrite_with_export(repo, output):
repo = path(repo)
output = path(output)
if not output.exists():
log.critical("Output dir does not exist: {}".format(output))
create = raw_input("Shall I create the output directory? [N/y] ")
if create is 'y' or create is 'Y':
output.mkdir()
for p in repo.files():
p.copy(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment