Skip to content

add check for commands from string #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lfric_macros/apply_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,14 @@ def combine_macros(self, import_order):
and "commands" in self.target_macros[meta_import]
):
# Add a comment labelling where these commands came from
full_command += (
" # Commands From: "
f"{self.parse_application_section(meta_import)}\n"
)
# Check the comment hasn't already been added
if not re.search(
r"Commands From: \w+", self.target_macros[meta_import]["commands"]
):
full_command += (
" # Commands From: "
f"{self.parse_application_section(meta_import)}\n"
)
if self.target_macros[meta_import]["commands"].strip("\n"):
full_command += self.target_macros[meta_import]["commands"] + "\n"
else:
Expand Down