Skip to content

Commit

Permalink
fix leftover issue from #247 if build_dir does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmattlove committed Jun 1, 2024
1 parent 72887e0 commit ad88d02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hyperglass/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ async def build_ui(app_path: Path):
log.error(err)
raise RuntimeError(str(err)) from err

shutil.rmtree(build_dir)
if build_dir.exists():
shutil.rmtree(build_dir)
else:
build_dir.mkdir()
shutil.copytree(src=out_dir, dst=build_dir, dirs_exist_ok=False)
log.bind(src=out_dir, dst=build_dir).debug("Migrated Next.JS build output")

Expand Down

0 comments on commit ad88d02

Please sign in to comment.