Skip to content

Commit

Permalink
Merge pull request #200 from jakub-nt/ENT-10229
Browse files Browse the repository at this point in the history
ENT-10229: Improved the warning text when an added local module contains a policy file with an autorun tag
  • Loading branch information
olehermanse authored Aug 2, 2024
2 parents 311902d + 45401e6 commit 170b1f9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cfbs/cfbs_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,18 @@ def _handle_local_module(self, module):
pattern = "%s/**/*.cf" % name
policy_files = glob.glob(pattern, recursive=True)

modules_available = [m.get("name", "") for m in self.get("build", [])]
is_autorun_enabled = any(
m in modules_available for m in ["autorun", "./def.json"]
) # only a heuristic

for file in policy_files:
if _has_autorun_tag(file):
log.warning(
"Found bundle tagged with autorun in local policy file '%s': "
% file
+ "Note that the autorun tag is ignored when adding local policy files or subdirectories."
)
if not is_autorun_enabled:
log.warning(
"Found autorun tag in '%s', " % file
+ "but it looks like the autorun feature is not enabled, consider enabling it via 'cfbs add autorun' or a custom './def.json' file."
)
# TODO: Support adding local modules with autorun tag

self._add_policy_files_build_step(module)
Expand Down

0 comments on commit 170b1f9

Please sign in to comment.