diff --git a/.devcontainer/post-start.sh b/.devcontainer/post-start.sh index d23a875..34b084f 100755 --- a/.devcontainer/post-start.sh +++ b/.devcontainer/post-start.sh @@ -1,5 +1,16 @@ #!/bin/bash +set -u + +# Ensure that the colrev package is available before using it. When the +# Codespaces image cache does not include the dependency, installing it on +# demand keeps the setup reproducible for new workspaces as well as locally. +if ! command -v colrev >/dev/null 2>&1; then + if ! python -m pip install --no-cache-dir "git+https://github.com/CoLRev-Environment/colrev"; then + echo "Warning: Failed to install colrev automatically." >&2 + fi +fi + colrev install all_internal_packages # Pull Docker images for repo in pandoc/latex:3.2.0 lfoppiano/grobid:0.8.1 jbarlow83/ocrmypdf:latest; do