Skip to content

Commit 8832951

Browse files
committed
roll back check-broken-links-internal.py
1 parent fc1eca3 commit 8832951

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

scripts/check-broken-links-internal.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,34 +90,23 @@ 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-
9793
parser = argparse.ArgumentParser(
9894
description="Check for broken internal links."
9995
)
10096
parser.add_argument(
10197
"--port", "-p", default=8000, type=int, help="Port for HTTP server."
10298
)
10399
parser.add_argument(
104-
"--folder",
105-
"-f",
106-
default=None,
107-
type=str,
108-
help="Folder to serve (default: repo root / build).",
100+
"--folder", "-f", default="build", type=str, help="Folder to serve."
109101
)
110102
args = parser.parse_args()
111103

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

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

122111
# Start the HTTP server
123112
server = start_http_server(folder_path, HTTP_PORT)

0 commit comments

Comments
 (0)