Skip to content

Commit b45b044

Browse files
Fixed warning about lack of defined acts
1 parent d3309af commit b45b044

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

bpy_addon_build/build_context.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def action(self, action: str, folder: Path) -> None:
150150
Returns:
151151
None
152152
"""
153-
if self.config.build_actions is None:
153+
if self.config.build_actions is None and len(self.cli.actions):
154154
print("Actions must be defined to use them!")
155155
return
156156
if action in self.cli.actions:
@@ -161,12 +161,13 @@ def action(self, action: str, folder: Path) -> None:
161161
# its entirity. Otherwise, the
162162
# addon will be built with a weird
163163
# result.
164-
subprocess.Popen(
165-
[
166-
"python",
167-
self.config_path.parent.resolve().joinpath(
168-
Path(self.config.build_actions[action].script)
169-
),
170-
],
171-
cwd=folder,
172-
).wait()
164+
if self.config.build_actions is not None:
165+
subprocess.Popen(
166+
[
167+
"python",
168+
self.config_path.parent.resolve().joinpath(
169+
Path(self.config.build_actions[action].script)
170+
),
171+
],
172+
cwd=folder,
173+
).wait()

0 commit comments

Comments
 (0)