Skip to content

Commit

Permalink
chore: fix bugs in redirects.py (determined-ai#6958)
Browse files Browse the repository at this point in the history
  • Loading branch information
rb-determined-ai authored May 24, 2023
1 parent 77e08fa commit 5a7a7f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,15 @@ def all_urls_from_files():
published = set(json.loads(atext))

if sys.argv[1] == "redirect":
if len(sys.argv) == 4:
if len(sys.argv) != 4:
print(__doc__, file=sys.stderr)
exit(1)

print(f"redirecting {src} to {dst}", file=sys.stderr)

src = sys.argv[2]
dst = sys.argv[3]

print(f"redirecting {src} to {dst}", file=sys.stderr)

links = rename_one(links, published, src, dst)
write_json(dict(l.to_sphinx() for l in links), REDIRECTS)

Expand Down

0 comments on commit 5a7a7f8

Please sign in to comment.