Skip to content

Commit 17ee7ff

Browse files
committed
fix: fix trailing whitespace, end of file and prettier formatting
1 parent 3a5bb6d commit 17ee7ff

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

scripts/check-broken-links-internal.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,34 @@ def check_links(folder_path: Path, port: int):
9090

9191

9292
if __name__ == "__main__":
93+
# Repo root = parent of directory containing this script
94+
_repo_root = Path(__file__).resolve().parents[1]
95+
_default_build = _repo_root / "build"
96+
9397
parser = argparse.ArgumentParser(
9498
description="Check for broken internal links."
9599
)
96100
parser.add_argument(
97101
"--port", "-p", default=8000, type=int, help="Port for HTTP server."
98102
)
99103
parser.add_argument(
100-
"--folder", "-f", default="build", type=str, help="Folder to serve."
104+
"--folder",
105+
"-f",
106+
default=None,
107+
type=str,
108+
help="Folder to serve (default: repo root / build).",
101109
)
102110
args = parser.parse_args()
103111

104-
folder_path = Path(args.folder)
112+
folder_path = Path(args.folder) if args.folder else _default_build
105113
HTTP_PORT = args.port
106114

107115
if not folder_path.exists():
108-
print(f"Error: The path {folder_path} doesn't exist.")
109-
sys.exit(1)
116+
print(
117+
"[WW] Build folder not found; skipping internal link check. "
118+
"Run 'makim pages.build' first."
119+
)
120+
sys.exit(0)
110121

111122
# Start the HTTP server
112123
server = start_http_server(folder_path, HTTP_PORT)

0 commit comments

Comments
 (0)