summaryrefslogtreecommitdiff
path: root/unperish
diff options
context:
space:
mode:
Diffstat (limited to 'unperish')
-rwxr-xr-xunperish16
1 files changed, 16 insertions, 0 deletions
diff --git a/unperish b/unperish
index 40b3038..eb32618 100755
--- a/unperish
+++ b/unperish
@@ -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']