🔨 Update docs.py script to enable dirty reload conditionally (#1060)

This commit is contained in:
Sebastián Ramírez 2024-08-09 16:28:38 -05:00 committed by GitHub
parent 26a93e1e7d
commit 843ed98f76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,7 +104,7 @@ def verify_readme() -> None:
@app.command() @app.command()
def live() -> None: def live(dirty: bool = False) -> None:
""" """
Serve with livereload a docs site for a specific language. Serve with livereload a docs site for a specific language.
@ -115,11 +115,10 @@ def live() -> None:
en. en.
""" """
# Enable line numbers during local development to make it easier to highlight # Enable line numbers during local development to make it easier to highlight
subprocess.run( args = ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008"]
["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008", "--dirty"], if dirty:
env={**os.environ, "LINENUMS": "true"}, args.append("--dirty")
check=True, subprocess.run(args, env={**os.environ, "LINENUMS": "true"}, check=True)
)
@app.command() @app.command()