diff --git a/.devcontainer/prototyping/onCreateCommand.sh b/.devcontainer/prototyping/onCreateCommand.sh index e7b615d..460045c 100755 --- a/.devcontainer/prototyping/onCreateCommand.sh +++ b/.devcontainer/prototyping/onCreateCommand.sh @@ -13,13 +13,18 @@ echo "source $XDG_CONFIG_HOME/nf-neuro/.env" >> ~/.bashrc wget -N $NFNEURO_RAW_REPOSITORY/pyproject.toml \ $NFNEURO_RAW_REPOSITORY/poetry.toml \ $NFNEURO_RAW_REPOSITORY/poetry.lock +} || { + echo "Failed to download nf-neuro base project configuration. Creating requirements.txt for pip" + echo "nf-core==$NFCORE_VERSION" > requirements.txt +} - poetry install --no-root +# Try to download VSCode settings from nf-neuro +{ + NFNEURO_RAW_REPOSITORY=https://raw.githubusercontent.com/scilus/nf-neuro/main + mkdir -p .vscode + wget -N -P .vscode $NFNEURO_RAW_REPOSITORY/.vscode/settings.json } || { - echo "Failed to download nf-neuro base project configuration." - echo "Installing nf-core version $NFCORE_VERSION in the current python" - echo "interpreter using pip" - python3 -m pip install nf-core==$NFCORE_VERSION + echo "Could not fetch default extension settings from nf-neuro" } # Initial setup for a pipeline prototyping environment diff --git a/.devcontainer/prototyping/updateContentCommand.sh b/.devcontainer/prototyping/updateContentCommand.sh index 3624a2d..8a3e9f9 100644 --- a/.devcontainer/prototyping/updateContentCommand.sh +++ b/.devcontainer/prototyping/updateContentCommand.sh @@ -19,3 +19,15 @@ export DEVCONTAINER_CPU_LIMIT=$(grep -c ^processor /proc/cpuinfo) EOF unset maxmem +NFCORE_VERSION=2.14.1 + +if [ -f poetry.lock ] && [ -f pyproject.toml ] +then + poetry install --no-root +elif [ -f requirements.txt ] +then + python3 -m pip install -r requirements.txt +else + echo "No requirements file found, installing nf-core to version $NFCORE_VERSION using pip" + python3 -m pip install nf-core==$NFCORE_VERSION +fi