GitNexus/.devcontainer/seed-codex.sh
Gergő Magyar b961e695ca
Some checks failed
Devcontainer Smoke / Config-transform unit tests (push) Has been cancelled
Devcontainer Smoke / Build devcontainer image (default) (push) Has been cancelled
Publish Development Images / publish (core) (push) Has been cancelled
Publish Development Images / publish (ui) (push) Has been cancelled
Devcontainer Smoke / Build devcontainer image (ui) (push) Has been cancelled
CodeQL / Analyze (python) (push) Waiting to run
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Gitleaks / gitleaks (push) Waiting to run
Publish / ci (push) Blocked by required conditions
Publish / Classify release event (push) Waiting to run
Publish / RC guard (marker + release-PR skip) (push) Blocked by required conditions
Publish / Publish to npm (push) Blocked by required conditions
Publish / Build & Push RC Docker images (push) Blocked by required conditions
Scorecard / Scorecard analysis (push) Waiting to run
Skill copy sync / shipped skills drift guard (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-cli) (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-web) (push) Waiting to run
fix(devcontainer): refresh Node and streamline development (#3610)
2026-10-17 21:05:13 +00:00

25 lines
981 B
Bash

#!/usr/bin/env bash
# Restore the image's standalone Codex package into its mounted config volume.
# Optional paths allow migration tests to use isolated temporary directories.
set -euo pipefail
seed=${1:-/home/node/.local/share/codex-standalone}
standalone=${2:-/home/node/.codex/packages/standalone}
command=${3:-/home/node/.local/bin/codex}
if [ -x "$command" ] && "$command" --version >/dev/null 2>&1; then
exit 0
fi
echo "[post-create] restoring standalone Codex into its config volume"
test -d "$seed/releases"
test -L "$seed/current"
mkdir -p "$standalone/releases"
# Copy only packages; credentials, sessions and user configuration stay intact.
# Publish `current` after copying so an interrupted copy can be retried.
cp -r "$seed/releases/." "$standalone/releases/"
if [ -f "$seed/auto-update-version" ]; then
cp "$seed/auto-update-version" "$standalone/auto-update-version"
fi
ln -sfn "$(readlink "$seed/current")" "$standalone/current"
"$command" --version