diff options
Diffstat (limited to 'unperish')
-rwxr-xr-x | unperish | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -60,6 +60,12 @@ class Unperish(cliapp.Application): self.settings.string(['web-directory'], 'put files to go on the web in DIR', metavar='DIR') + self.settings.string_list(['rsync-glob'], + 'publish files matching GLOB with rsync', + metavar='GLOB') + self.settings.string_list(['rsync-to'], + 'publish files with rsync to LOCATION', + metavar='LOCATION') def process_args(self, args): self.meta = self.create_meta() @@ -260,6 +266,16 @@ class Unperish(cliapp.Application): publish(name, manpage + '.txt') os.remove(name) + def cmd_rsync_publish(self, args): + '''Publish files via rsync.''' + + filenames = [] + for pattern in self.settings['rsync-glob']: + filenames += glob.glob(pattern) + + self.runcmd(['rsync', '-av', '--delete-after'] + filenames + + self.settings['rsync-to']) + def cmd_clean(self, args): '''Clean up the build-area (remove everything except the dir).''' area = self.settings['build-area'] |