Skip to content

Commit

Permalink
Copy over env instead
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Oct 10, 2024
1 parent ad25f7d commit 197ecce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:report": "../../.venv/bin/pipenv run python -m coverage html && xdg-open htmlcov/index.html",
"lint": "../../.venv/bin/pipenv run pyright && ../../.venv/bin/pipenv run pylint --rcfile=../../.pylintrc api_server --ignore=ros_pydantic,rmf_api,rmf_ros2",
"generate-models": "./generate-models.sh",
"generate-docs": "../../.venv/bin/pipenv run python scripts/extract_docs.py -o docs"
"generate-docs": "RMF_API_SERVER_CONFIG=scripts/docs_config.py ../../.venv/bin/pipenv run python scripts/extract_docs.py -o docs"
},
"devDependencies": {
"pipenv-install": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/scripts/docs_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

config.update(
{
"public_url": "http://localhost:8000/rmf-web",
"public_url": "/rmf-web",
}
)
3 changes: 2 additions & 1 deletion packages/api-server/scripts/extract_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ def cleanup():
("python", "-m", "api_server"),
cwd=f"{os.path.dirname(__file__)}/..",
start_new_session=True,
env=os.environ.copy(),
)

time.sleep(5) # wait for server to be ready
outdir = f"{args.output}"
os.makedirs(outdir, exist_ok=True)

base_url = "http://localhost:8000"
base_url = "http://localhost:8000/rmf-web"
with urlopen(f"{base_url}/docs") as resp:
html: bytes = resp.read()
with open(f"{outdir}/index.html", "bw") as f:
Expand Down

0 comments on commit 197ecce

Please sign in to comment.