From d08aaebc8fa6d34997a5d79101d70aa5c455282d Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 16 Jun 2023 00:14:01 +0800 Subject: [PATCH] add if statement for cmd option --- libs/utils/nuitka.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libs/utils/nuitka.py b/libs/utils/nuitka.py index 1733cd3..4aeeeea 100644 --- a/libs/utils/nuitka.py +++ b/libs/utils/nuitka.py @@ -136,14 +136,20 @@ class CompilerHelper(Options): if icon_cmd: cmd_list.append(icon_cmd) - cmd_list += [f"--include-data-dir={src}={dst}" for src, dst in self.include_data_dir] - cmd_list += [f"--include-package={package}" for package in self.include_packages] + if self.include_data_dir: + cmd_list += [f"--include-data-dir={src}={dst}" for src, dst in self.include_data_dir] + if self.include_packages: + cmd_list += [f"--include-package={package}" for package in self.include_packages] - cmd_list.append(f"--follow-import-to={','.join(self.follow_import)}") - cmd_list.append(f"--nofollow-import-to={','.join(self.no_follow_import)}") + if self.follow_import: + cmd_list.append(f"--follow-import-to={','.join(self.follow_import)}") + if self.no_follow_import: + cmd_list.append(f"--nofollow-import-to={','.join(self.no_follow_import)}") - cmd_list.append(f"--enable-plugin={','.join(self.enable_plugin)}") - cmd_list.append(f"--disable-plugin={','.join(self.disable_plugin)}") + if self.enable_plugin: + cmd_list.append(f"--enable-plugin={','.join(self.enable_plugin)}") + if self.disable_plugin: + cmd_list.append(f"--disable-plugin={','.join(self.disable_plugin)}") cmd_list.append(f"{self.src_file}") return cmd_list