File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,20 +58,15 @@ def get_versions(ref: str, add: str | None) -> list[str]:
5858def write_json (path : Path , repository : str , versions : list [str ]):
5959 """Write the JSON switcher to path."""
6060 org , repo_name = repository .split ("/" )
61- struct = [
62- {"version" : version , "url" : f"https://{ org } .github.io/{ repo_name } /{ version } /" }
63- for version in versions
64- ]
61+ struct = [{"version" : version , "url" : f"https://{ org } .github.io/{ repo_name } /{ version } /" } for version in versions ]
6562 text = json .dumps (struct , indent = 2 )
6663 print (f"JSON switcher:\n { text } " )
6764 path .write_text (text , encoding = "utf-8" )
6865
6966
7067def main (args = None ):
7168 """Parse args and write switcher."""
72- parser = ArgumentParser (
73- description = "Make a versions.json file from gh-pages directories"
74- )
69+ parser = ArgumentParser (description = "Make a versions.json file from gh-pages directories" )
7570 parser .add_argument (
7671 "--add" ,
7772 help = "Add this directory to the list of existing directories" ,
You can’t perform that action at this time.
0 commit comments