mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-13 18:46:17 +05:00
Restore checkout venv after apt docs install
This commit is contained in:
parent
e617120e8e
commit
1eef0ccaa3
@ -435,7 +435,9 @@ def run_snippets(snippet_ids: tuple[str, ...]) -> None:
|
||||
current_python = ROOT / ".venv" / "bin" / "python"
|
||||
if not current_python.exists():
|
||||
current_python = Path(sys.executable)
|
||||
current_uv = Path(env["UV_BINARY"])
|
||||
assert current_python.is_file() and os.access(current_python, os.X_OK)
|
||||
assert current_uv.is_file() and os.access(current_uv, os.X_OK)
|
||||
checkout_import_root = system_home / "current-checkout"
|
||||
shutil.copytree(
|
||||
ROOT / "archivebox",
|
||||
@ -450,6 +452,9 @@ def run_snippets(snippet_ids: tuple[str, ...]) -> None:
|
||||
archivebox_wrapper = local_bin_dir / "archivebox"
|
||||
archivebox_wrapper.write_text(
|
||||
"#!/usr/bin/env bash\n"
|
||||
f'if ! {current_python} -c "import rich.panel" >/dev/null 2>&1; then\n'
|
||||
f" (cd {ROOT} && {current_uv} --no-cache sync --locked --dev >/dev/null)\n"
|
||||
"fi\n"
|
||||
f'export PYTHONPATH="{checkout_import_root}${{PYTHONPATH:+:${{PYTHONPATH}}}}"\n'
|
||||
f'exec {current_python} -m archivebox "$@"\n',
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user