Skip to content

Commit 843ed98

Browse files
authored
🔨 Update docs.py script to enable dirty reload conditionally (#1060)
1 parent 26a93e1 commit 843ed98

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/docs.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def verify_readme() -> None:
104104

105105

106106
@app.command()
107-
def live() -> None:
107+
def live(dirty: bool = False) -> None:
108108
"""
109109
Serve with livereload a docs site for a specific language.
110110
@@ -115,11 +115,10 @@ def live() -> None:
115115
en.
116116
"""
117117
# Enable line numbers during local development to make it easier to highlight
118-
subprocess.run(
119-
["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008", "--dirty"],
120-
env={**os.environ, "LINENUMS": "true"},
121-
check=True,
122-
)
118+
args = ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008"]
119+
if dirty:
120+
args.append("--dirty")
121+
subprocess.run(args, env={**os.environ, "LINENUMS": "true"}, check=True)
123122

124123

125124
@app.command()

0 commit comments

Comments
 (0)