diff --git a/util/cmake/README.md b/util/cmake/README.md index 256e481680..f8a6e9f540 100644 --- a/util/cmake/README.md +++ b/util/cmake/README.md @@ -36,7 +36,7 @@ python3.7 -m pip install -r requirements.txt # Contributing to the scripts -You can verify if the styling of a script complaint with PEP8, with a couple of exceptions: +You can verify if the styling of a script is compliant with PEP8, with a couple of exceptions: Install [flake8](http://flake8.pycqa.org/en/latest/) (`pip install flake8`) and run it on the script you want to test: diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index a5d44b4195..b5e148f63c 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -1520,11 +1520,9 @@ class special_cased_file: def __exit__(self, type, value, trace_back): self.file.close() - if self.preserve_special_cases and self.sc_handler.handle_special_cases(): - os.replace(self.gen_file_path, self.file_path) - else: - os.replace(self.gen_file_path, self.file_path) - + if self.preserve_special_cases: + self.sc_handler.handle_special_cases() + os.replace(self.gen_file_path, self.file_path) def processJson(path, ctx, data, skip_special_case_preservation=False): ctx["project_dir"] = path @@ -1572,11 +1570,8 @@ def main(): print("This scripts needs one directory to process!") quit(1) - skip_special_case_preservation = False - if len(sys.argv) > 2 and sys.argv[2] == "-s": - skip_special_case_preservation = True - directory = sys.argv[1] + skip_special_case_preservation = '-s' in sys.argv[2:] print(f"Processing: {directory}.")