Skip to content

Commit 1456ef6

Browse files
authored
check_macro_chains to fail gracefully on FCM (#148)
* add error message * add debug message * add space * remove debug print
1 parent 6701961 commit 1456ef6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lfric_macros/check_macro_chains.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,26 @@ def compare_tags(before, after, path, errors):
9898
) + "\n".join(x for x in single_tags)
9999

100100

101+
def check_fcm():
102+
"""
103+
Check if this script is being run for a fcm working copy and fail gracefully
104+
if so.
105+
"""
106+
dependency = os.path.join(os.environ["SOURCE_ROOT"], "apps", "dependencies.sh")
107+
108+
if os.path.exists(dependency):
109+
raise Exception(
110+
"[ERROR] check_macro_chains.py no longer works with FCM sources. "
111+
"Please ignore this error until you have migrated your work "
112+
"to GitHub. Thank you"
113+
)
114+
115+
101116
def main():
102117
"""
103118
Main function of the program
104119
"""
120+
check_fcm()
105121

106122
source_apps = os.path.join(os.environ["SOURCE_ROOT"], "lfric_apps")
107123
source_core = os.path.join(os.environ["SOURCE_ROOT"], "lfric_core")

0 commit comments

Comments
 (0)