From a879d93bab99490458670fd59c1bd77698714859 Mon Sep 17 00:00:00 2001 From: devcontainer Date: Fri, 10 Jul 2026 09:26:30 +0000 Subject: [PATCH] devcontainer: add post_create.sh wrapper and update postCreateCommand --- .devcontainer/devcontainer.json | 2 +- .devcontainer/post_create.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/post_create.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5338bb9..deb5499 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,5 @@ ] } }, - "postCreateCommand": "pip3 install -r requirements.txt && python3 -m pip install --user --upgrade 'setuptools>=64' 'wheel>=0.42' 'pip>=24' && python3 -m pip install --user -e . && echo 'export PATH=\"$HOME/.local/bin:$PATH\"' >> ~/.bashrc && source ~/.bashrc && bash external/setup_loki_b.sh --non-interactive && echo 'Workspace ready. Run: make regtest'" + "postCreateCommand": "bash -lc \"bash .devcontainer/post_create.sh\"" } \ No newline at end of file diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh new file mode 100644 index 0000000..2305359 --- /dev/null +++ b/.devcontainer/post_create.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Wrapper for devcontainer postCreate tasks — run from repo root +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +cd "$REPO_ROOT" + +echo "Running devcontainer post-create tasks in $REPO_ROOT" + +pip3 install -r requirements.txt +python3 -m pip install --user --upgrade 'setuptools>=64' 'wheel>=0.42' 'pip>=24' +python3 -m pip install --user -e . + +# Ensure user-local bin is on PATH for interactive shells +echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc +. ~/.bashrc + +# Run LoKI-B setup (non-interactive) +bash "$REPO_ROOT/external/setup_loki_b.sh" --non-interactive + +echo "Workspace ready. Run: make regtest"