From 90c6bc09b6d830b7e5affc9c1d06ec9153701587 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 19 Dec 2019 15:40:25 -0700 Subject: [PATCH] Make the export optional when running a release build --- builders/builder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index e36101b..596de87 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -149,6 +149,8 @@ class Builder(object): parser.add_argument('-b', '--branch', metavar='PATH', help='Specify the path to the branch you wish to build') parser.add_argument('-r', '--release', metavar='VERSION', default=None, help='Build a release version of OpenLP with the version specified') + parser.add_argument('-x', '--export', dest='can_export', action='store_true', default=False, + help='Export when building a release. Defaults to false, ignored for non-release builds') parser.add_argument('-d', '--documentation', metavar='PATH', default=None, help='Specify the path to the documentation branch') parser.add_argument('-t', '--update-translations', action='store_true', default=False, @@ -214,9 +216,11 @@ class Builder(object): self.documentation_path = os.path.abspath(self.args.documentation) if self.args.release: self.version = self.args.release - self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version)) else: self.version = None + if self.args.release and self.args.can_export: + self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version)) + else: self.work_path = self.branch_path self.openlp_script = os.path.abspath(os.path.join(self.work_path, 'openlp', '__main__.py')) self.source_path = os.path.join(self.work_path, 'openlp') @@ -492,7 +496,7 @@ class Builder(object): self._print_verbose('') if not self.args.skip_update: self.update_code() - if self.args.release: + if self.args.release and self.args.can_export: self.export_release() self.run_pyinstaller() self.write_version_file()