mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2026-04-07 10:22:21 +00:00
fix(docs): fix tasks.py
This commit is contained in:
parent
fe6a1ab79b
commit
7d2647b656
1 changed files with 3 additions and 7 deletions
10
tasks.py
10
tasks.py
|
|
@ -1,7 +1,9 @@
|
||||||
from invoke import task
|
from invoke import task
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
|
|
@ -154,17 +156,11 @@ def format_check(c):
|
||||||
@task(help={"o": "Open documentation in the default browser after generation."})
|
@task(help={"o": "Open documentation in the default browser after generation."})
|
||||||
def docs(c, o=False):
|
def docs(c, o=False):
|
||||||
"""Generate Doxygen documentation."""
|
"""Generate Doxygen documentation."""
|
||||||
task_begin("docs", "Docs")
|
|
||||||
proc = subprocess.run("doxygen Doxyfile", shell=True)
|
proc = subprocess.run("doxygen Doxyfile", shell=True)
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
task_end("docs", "done", "Docs generated")
|
|
||||||
path = "docs/doxygen/html/index.html"
|
path = "docs/doxygen/html/index.html"
|
||||||
console.print(
|
print(f"\n✓ Documentation generated in {path}")
|
||||||
f"\n[bold green]✓ Documentation generated in {path}[/bold green]"
|
|
||||||
)
|
|
||||||
if o:
|
if o:
|
||||||
import webbrowser
|
|
||||||
webbrowser.open(f"file://{os.path.abspath(path)}")
|
webbrowser.open(f"file://{os.path.abspath(path)}")
|
||||||
return
|
return
|
||||||
task_end("docs", "failed", "Doxygen failed")
|
|
||||||
raise Exit(code=1)
|
raise Exit(code=1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue