(input_file="NOTICE.yml")
| 45 | |
| 46 | |
| 47 | def main(input_file="NOTICE.yml"): |
| 48 | config = load_config(input_file) |
| 49 | for entry in config: |
| 50 | filelist = list(walk_directory(entry)) |
| 51 | with tempfile.NamedTemporaryFile(mode="w") as header_file: |
| 52 | header_file.write(entry["header"]) |
| 53 | header_file.flush() |
| 54 | header_file.seek(0) |
| 55 | command = ["licenseheaders", "-t", str(header_file.name), "-f"] + filelist |
| 56 | result = subprocess.run(command, capture_output=True) |
| 57 | if result.returncode != 0: |
| 58 | print(result.stdout.decode()) |
| 59 | print(result.stderr.decode()) |
| 60 | |
| 61 | |
| 62 | if __name__ == "__main__": |
no test coverage detected