From 0149dc845fd2ef954f487d50b41af1e5dafabd0b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 24 Jul 2011 11:05:15 +0100 Subject: Add publish-docs command. --- unperish | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'unperish') diff --git a/unperish b/unperish index 4bc6ef2..d293382 100755 --- a/unperish +++ b/unperish @@ -56,6 +56,9 @@ class Unperish(cliapp.Application): 'Debian source package name (typically detected ' 'from debian/control)') self.settings.string(['arch'], 'architecture for Debian packages') + self.settings.string(['web-directory'], + 'put files to go on the web in DIR', + metavar='DIR') def process_args(self, args): self.meta = self.create_meta() @@ -228,6 +231,18 @@ class Unperish(cliapp.Application): out = self.runcmd(['lintian', '-i'] + files, ignore_fail=True, cwd=self.settings['build-area']) self.output.write(out) + + def cmd_publish_docs(self, args): + '''Publish docs related to this project.''' + + docs = ['README', 'NEWS'] + for doc in docs: + if os.path.exists(doc): + target = os.path.join(self.settings['web-directory'], + doc + '.mdwn') + if self.settings['verbose']: + print 'Copying %s to %s' % (doc, target) + shutil.copyfile(doc, target) def cmd_clean(self, args): '''Clean up the build-area (remove everything except the dir).''' -- cgit v1.2.1