Skip to content

Commit

Permalink
Fixes demo data command to handle custom path
Browse files Browse the repository at this point in the history
So demo data is only relevant for the local backend.
It also should use the `burr_path` env variable if present.
This is unclean because we leak encapsulation from the
actual burr local backend...
  • Loading branch information
skrawcz authored and elijahbenizzy committed Sep 4, 2024
1 parent 34c68fe commit 365c3e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions burr/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ def _run_server(
cmd = f"uvicorn burr.tracking.server.run:app --port {port} --host {host}"
if dev_mode:
cmd += " --reload"
base_dir = os.path.expanduser("~/.burr")
if not no_copy_demo_data:

if backend == "local" and not no_copy_demo_data:
# TODO: fix this so we don't leak burr_path here since that's the value the local backend users
base_dir = os.environ.get("burr_path", os.path.expanduser("~/.burr"))
logger.info(f"Copying demo data over to {base_dir}...")
demo_data_path = files("burr").joinpath("tracking/server/demo_data")
for top_level in os.listdir(demo_data_path):
Expand Down

0 comments on commit 365c3e8

Please sign in to comment.