# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1685444663 -3600
#      Tue May 30 12:04:23 2023 +0100
# Node ID c66ba6c0a78c2b08eef3f19622b71e7a3c244208
# Parent  29ca11baf516438d8d64caf6db4ac7348abad982
setup-base-dir: make a poulpe binary easy to access

diff --git a/suites/hg/scheduling/setup-base-dir b/suites/hg/scheduling/setup-base-dir
--- a/suites/hg/scheduling/setup-base-dir
+++ b/suites/hg/scheduling/setup-base-dir
@@ -40,6 +40,14 @@
         subprocess.run(command, check=True)
 
 
+def setup_quick_access():
+    Path("bin").mkdir(parents=True)
+
+    env_bin = Path("..") / ".venv" / "bin"
+    dir_bin = Path("bin")
+    os.symlink(env_bin / "poulpe", dir_bin / "poulpe")
+
+
 def setup_base_dir(path):
     base_path = Path(path)
     old_dir = os.curdir
@@ -51,6 +59,7 @@
         base_path.joinpath(BIN_ENV_DIR).mkdir()
         base_path.joinpath(DATA_ENV_DIR).mkdir()
         install_poulpe()
+        setup_quick_access()
 
         print("Create symlinks to development Poulpe for suites")
         source = (POULPE_DIR / SUITE_DIR).resolve()