MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / sanitize_permissions

Function sanitize_permissions

scripts/sanitize-commit.py:58–75  ·  view source on GitHub ↗
(root: Path)

Source from the content-addressed store, hash-verified

56
57
58def 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
78def iter_source_files(root: Path):

Callers 1

mainFunction · 0.85

Calls 2

captureFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected