yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sek...@apache.org
Subject yetus git commit: Allow releasedocmaker to use output directory
Date Wed, 06 Jan 2016 01:31:03 GMT
Repository: yetus
Updated Branches:
  refs/heads/master 32c4d4860 -> 0d22ad1cc


Allow releasedocmaker to use output directory

Signed-off-by: Kengo Seki <sekikn@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/0d22ad1c
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/0d22ad1c
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/0d22ad1c

Branch: refs/heads/master
Commit: 0d22ad1cc1c6bc7c7af91a52beed96af8c122526
Parents: 32c4d48
Author: Pathangi Janardhanan Jatinshravan <jatinshravan@gmail.com>
Authored: Thu Dec 31 04:50:09 2015 +0800
Committer: Kengo Seki <sekikn@apache.org>
Committed: Wed Jan 6 10:24:25 2016 +0900

----------------------------------------------------------------------
 release-doc-maker/releasedocmaker.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/0d22ad1c/release-doc-maker/releasedocmaker.py
----------------------------------------------------------------------
diff --git a/release-doc-maker/releasedocmaker.py b/release-doc-maker/releasedocmaker.py
index 23779ea..70a2f8c 100755
--- a/release-doc-maker/releasedocmaker.py
+++ b/release-doc-maker/releasedocmaker.py
@@ -466,6 +466,8 @@ def main():
                       help="versions in JIRA to include in releasenotes", metavar="VERSION")
     parser.add_option("-V", dest="release_version", action="store_true", default=False,
                       help="display version information for releasedocmaker and exit.")
+    parser.add_option("-O", "--outputdir", dest="output_directory", action="append", type="string",
+                      help="specify output directory to put release docs to.")
     (options, _) = parser.parse_args()
 
     if options.release_version:
@@ -476,6 +478,16 @@ def main():
     if options.versions is None:
         parser.error("At least one version needs to be supplied")
 
+    if options.output_directory is not None:
+        if len(options.output_directory) > 1:
+            parser.error("Only one output directory should be given")
+        if not os.path.isdir(options.output_directory[0]):
+            try:
+                os.makedirs(options.output_directory[0])
+            except OSError:
+                parser.error("Unable to create output directory that does not exist")
+        os.chdir(options.output_directory[0])
+
     proxy = urllib2.ProxyHandler()
     opener = urllib2.build_opener(proxy)
     urllib2.install_opener(opener)


Mime
View raw message