diff --git a/src/bun/devcontainer-feature.json b/src/bun/devcontainer-feature.json index 6733ed2..147adf3 100644 --- a/src/bun/devcontainer-feature.json +++ b/src/bun/devcontainer-feature.json @@ -1,10 +1,14 @@ { "name": "Bun", "id": "bun", - "version": "1.1.3", + "version": "1.2.0", "description": "Installs Bun (Javascript runtime written in zig)", "documentationURL": "https://github.com/prulloac/devcontainer-features/tree/main/src/bun", "options": { + "version": { + "type": "string", + "default": "latest" + }, "useNpm": { "type": "boolean", "default": false diff --git a/src/bun/install.sh b/src/bun/install.sh index dfa01c1..e89a8e0 100644 --- a/src/bun/install.sh +++ b/src/bun/install.sh @@ -3,6 +3,7 @@ set -e USE_NPM="${USENPM:-"false"}" +VERSION="${VERSION:-"latest"}" if [ "${USE_NPM}" = "false" ]; then @@ -20,8 +21,12 @@ if [ "${USE_NPM}" = "false" ]; then check_packages ca-certificates curl unzip export BUN_INSTALL=/usr/local - curl -fsSL https://bun.sh/install | bash - + if [ "${VERSION}" = "latest" ]; then + curl -fsSL https://bun.sh/install | bash + else + curl -fsSL https://bun.sh/install | bash -s "bun-v${VERSION}" + fi + echo '# bun' >> /etc/bash.bashrc echo 'export BUN_INSTALL=/usr/local' >> /etc/bash.bashrc echo 'export PATH=$BUN_INSTALL/bin:$PATH' >> /etc/bash.bashrc @@ -43,7 +48,11 @@ else devcontainer-feature \ "ghcr.io/devcontainers/features/node:1" - npm install --global bun + if [ "${VERSION}" = "latest" ]; then + npm install --global bun + else + npm install --global bun@${VERSION} + fi echo '# bun' >> /etc/bash.bashrc echo 'export BUN_INSTALL=/usr/local' >> /etc/bash.bashrc diff --git a/src/latex/devcontainer-feature.json b/src/latex/devcontainer-feature.json index 242c4bc..468120c 100644 --- a/src/latex/devcontainer-feature.json +++ b/src/latex/devcontainer-feature.json @@ -1,45 +1,45 @@ -{ - "name": "LaTeX Workshop", - "id": "latex", - "version": "1.3.2", - "description": "Installs Tex Live latex compiler with tlmgr package manager, alongside LaTeX Workshop extension", - "documentationURL": "https://github.com/prulloac/devcontainer-features/tree/main/src/latex", - "options": { - "scheme": { - "type": "string", - "enum": [ - "full", - "medium", - "small", - "basic", - "minimal" - ], - "default": "basic", - "description": "Gives the option select which scheme is used to install Tex Live. See https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.2 for more information." - }, - "packages": { - "type": "string", - "default": "", - "description": "Comma separated list of packages to install with tlmgr. See https://www.tug.org/texlive/doc/tlmgr.html#installing-packages for more information." - }, - "mirror": { - "type": "string", - "default": "https://mirror.ctan.org/systems/texlive/tlnet/", - "description": "Provide a custom mirror to use for the installation of Tex Live. Omit option to automatically select the mirror closest to you.", - "proposals": [ - "https://mirror.ctan.org/systems/texlive/tlnet/", - "https://mirrors.mit.edu/CTAN/systems/texlive/tlnet" - ] - } - }, - "customizations": { - "vscode": { - "extensions": [ - "James-Yu.latex-workshop" - ] - } - }, - "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils" - ] -} +{ + "name": "LaTeX Workshop", + "id": "latex", + "version": "1.3.2", + "description": "Installs Tex Live latex compiler with tlmgr package manager, alongside LaTeX Workshop extension", + "documentationURL": "https://github.com/prulloac/devcontainer-features/tree/main/src/latex", + "options": { + "scheme": { + "type": "string", + "enum": [ + "full", + "medium", + "small", + "basic", + "minimal" + ], + "default": "basic", + "description": "Gives the option select which scheme is used to install Tex Live. See https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.2 for more information." + }, + "packages": { + "type": "string", + "default": "", + "description": "Comma separated list of packages to install with tlmgr. See https://www.tug.org/texlive/doc/tlmgr.html#installing-packages for more information." + }, + "mirror": { + "type": "string", + "default": "https://mirror.ctan.org/systems/texlive/tlnet/", + "description": "Provide a custom mirror to use for the installation of Tex Live. Omit option to automatically select the mirror closest to you.", + "proposals": [ + "https://mirror.ctan.org/systems/texlive/tlnet/", + "https://mirrors.mit.edu/CTAN/systems/texlive/tlnet" + ] + } + }, + "customizations": { + "vscode": { + "extensions": [ + "James-Yu.latex-workshop" + ] + } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/common-utils" + ] +} diff --git a/src/ollama/devcontainer-feature.json b/src/ollama/devcontainer-feature.json index cb68806..9745954 100644 --- a/src/ollama/devcontainer-feature.json +++ b/src/ollama/devcontainer-feature.json @@ -1,18 +1,18 @@ -{ - "name": "ollama", - "id": "ollama", - "version": "1.0.1", - "description": "Installs ollama", - "documentationURL": "https://github.com/prulloac/devcontainer-features/tree/main/src/ollama", - "options": { - "pull": { - "type":"string", - "default": "", - "description": "comma separated list of models to pull" - } - }, - "entrypoint": "ollama serve", - "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils" - ] -} +{ + "name": "ollama", + "id": "ollama", + "version": "1.0.1", + "description": "Installs ollama", + "documentationURL": "https://github.com/prulloac/devcontainer-features/tree/main/src/ollama", + "options": { + "pull": { + "type":"string", + "default": "", + "description": "comma separated list of models to pull" + } + }, + "entrypoint": "ollama serve", + "installsAfter": [ + "ghcr.io/devcontainers/features/common-utils" + ] +} diff --git a/test/bun/install_specific_version.sh b/test/bun/install_specific_version.sh new file mode 100644 index 0000000..dadbb4a --- /dev/null +++ b/test/bun/install_specific_version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "validate bun installation" bun --version | grep '1.0.0' + +reportResults \ No newline at end of file diff --git a/test/bun/install_specific_version_npm.sh b/test/bun/install_specific_version_npm.sh new file mode 100644 index 0000000..dadbb4a --- /dev/null +++ b/test/bun/install_specific_version_npm.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "validate bun installation" bun --version | grep '1.0.0' + +reportResults \ No newline at end of file diff --git a/test/bun/scenarios.json b/test/bun/scenarios.json index 39b7242..f3b71ec 100644 --- a/test/bun/scenarios.json +++ b/test/bun/scenarios.json @@ -45,5 +45,24 @@ } }, "remoteUser": "root" + }, + "install_specific_version": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "bun": { + "version": "1.0.0" + } + }, + "remoteUser": "vscode" + }, + "install_specific_version_npm": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "bun": { + "useNpm": true, + "version": "1.0.0" + } + }, + "remoteUser": "vscode" } } \ No newline at end of file