Skip to content
Snippets Groups Projects
Commit 3f8b3cfa authored by Campbell Barton's avatar Campbell Barton
Browse files

code_clean: skip operating on generated source files

This caused cleaning to fail on generated source files.
parent ed927886
No related branches found
No related tags found
No related merge requests found
...@@ -676,6 +676,15 @@ def run_edits_on_directory(build_dir, regex_list, edit_to_apply, skip_test=False ...@@ -676,6 +676,15 @@ def run_edits_on_directory(build_dir, regex_list, edit_to_apply, skip_test=False
return build_args[i + 1] return build_args[i + 1]
def test_path(c): def test_path(c):
# Skip any generated source files (files in the build directory).
if os.path.abspath(c).startswith(build_dir):
return False
# Raise an exception since this should never happen,
# we want to know about it early if it does, as it will cause failure
# when attenpting to compile the missing file.
if not os.path.exists(c):
raise Exception("Missing source file: " + c)
for source_path in source_paths: for source_path in source_paths:
index = c.rfind(source_path) index = c.rfind(source_path)
# print(c) # print(c)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment