(root: Path)
| 56 | |
| 57 | |
| 58 | def sanitize_permissions(root: Path) -> None: |
| 59 | if os.name != "posix": |
| 60 | return |
| 61 | |
| 62 | print("Sanitizing file permissions...") |
| 63 | tracked = capture(["git", "ls-files", "-z"]).split("\0") |
| 64 | for rel in tracked: |
| 65 | if not rel: |
| 66 | continue |
| 67 | path = root / rel |
| 68 | if not path.is_file(): |
| 69 | continue |
| 70 | if path.resolve() == SCRIPT_PATH: |
| 71 | continue |
| 72 | if path.suffix == ".sh": |
| 73 | path.chmod(0o755) |
| 74 | else: |
| 75 | path.chmod(0o644) |
| 76 | |
| 77 | |
| 78 | def iter_source_files(root: Path): |