diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-07-31 11:53:49 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-07-31 11:53:49 +0100 |
commit | 38a3b9fcaaab32bfc4dc5f9e02f62810024599d2 (patch) | |
tree | 81c545ea303ec4254318cc4865f529cba149cd2f | |
parent | d36f3358496b505a94ae49fc968497412dccc560 (diff) | |
download | unperish-38a3b9fcaaab32bfc4dc5f9e02f62810024599d2.tar.gz |
Add rsync-publish command.
-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'] |