From 976e4a3a50478e2eee3d114bd9766b0b162c8ee5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:47:40 +0000 Subject: [PATCH 1/3] Initial plan From 70e7a720a9ef2d363c5d22c56904cded085e86a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:51:49 +0000 Subject: [PATCH 2/3] Add dotenv.org feature (dotenvx via bun install -g @dotenvx/dotenvx) Co-authored-by: sebst <592313+sebst@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/33027f97-5f8c-44df-a808-13b6231f36ea --- README.md | 1 + src/dotenv.org/NOTES.md | 17 +++++++ src/dotenv.org/devcontainer-feature.json | 17 +++++++ src/dotenv.org/install.sh | 59 ++++++++++++++++++++++++ test/dotenv.org/test.sh | 19 ++++++++ 5 files changed, 113 insertions(+) create mode 100644 src/dotenv.org/NOTES.md create mode 100644 src/dotenv.org/devcontainer-feature.json create mode 100755 src/dotenv.org/install.sh create mode 100644 test/dotenv.org/test.sh diff --git a/README.md b/README.md index bd23fe1..d9e12cf 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ | [diffity.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/diffity.com) | `diffity` — agent-agnostic GitHub-style diff viewer and code review tool | npm | 1.0.0 | | [dolthub.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dolthub.com) | `dolt` — SQL database with Git-style versioning | gh release | 1.0.0 | | [dolthub.com/doltgres](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dolthub.com-doltgres) | `doltgres` — version-controlled PostgreSQL-compatible database | gh release | 1.0.0 | +| [dotenv.org](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dotenv.org) | `dotenvx` — better dotenv with multi-environment and encrypted secrets support | bun | 1.0.0 | | [dozzle.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dozzle.dev) | `dozzle` — real-time Docker container log viewer | curl | 1.0.0 | | [fathyb/carbonyl](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/fathyb-carbonyl) | `carbonyl` — Chromium-based browser that runs in a terminal | gh release | 1.0.0 | | [fd](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/fd) | `fd` — fast and user-friendly file finder | gh release | 1.0.0 | diff --git a/src/dotenv.org/NOTES.md b/src/dotenv.org/NOTES.md new file mode 100644 index 0000000..2a63f88 --- /dev/null +++ b/src/dotenv.org/NOTES.md @@ -0,0 +1,17 @@ +# dotenv.org + +## Project + +- [dotenvx](https://dotenv.org) + +## Description + +`dotenvx` is a better dotenv — load env vars from `.env` files, support multiple environments, and encrypt secrets. It extends the original dotenv with multi-environment support and encrypted `.env` files. + +## Installation Method + +Installed as a global package via [Bun](https://bun.sh) (`bun install -g @dotenvx/dotenvx`). Bun is automatically installed if not already present. + +## Other Notes + +_No additional notes._ diff --git a/src/dotenv.org/devcontainer-feature.json b/src/dotenv.org/devcontainer-feature.json new file mode 100644 index 0000000..55dbceb --- /dev/null +++ b/src/dotenv.org/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "name": "dotenv.org", + "id": "dotenv.org", + "version": "1.0.0", + "description": "Install \"dotenvx\" binary", + "documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dotenv.org", + "options": { + "version": { + "type": "string", + "default": "latest", + "proposals": [ + "latest" + ], + "description": "Version of \"dotenvx\" to install." + } + } +} diff --git a/src/dotenv.org/install.sh b/src/dotenv.org/install.sh new file mode 100755 index 0000000..6a50973 --- /dev/null +++ b/src/dotenv.org/install.sh @@ -0,0 +1,59 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o noclobber +set -o nounset +set -o allexport +readonly binaryName='dotenvx' +readonly binaryTargetFolder='/usr/local/bin' +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} +apt_get_checkinstall() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@" + fi +} +apt_get_cleanup() { + apt-get clean + rm -rf /var/lib/apt/lists/* +} +echo_banner() { + local text="$1" + echo -e "\e[1m\e[97m\e[41m$text\e[0m" +} +utils_check_version() { + local version=$1 + if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \ + "$version" + exit 1 + fi +} +bun_ensure_installed() { + if ! command -v bun >/dev/null 2>&1; then + echo "Bun is not installed. Installing bun to /usr/local..." + apt_get_checkinstall unzip curl ca-certificates + export BUN_INSTALL=/usr/local + curl -fsSL https://bun.sh/install | bash + fi +} +install() { + utils_check_version "$VERSION" + export BUN_INSTALL=/usr/local + bun_ensure_installed + if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then + bun install -g @dotenvx/dotenvx + else + bun install -g "@dotenvx/dotenvx@${VERSION}" + fi + apt_get_cleanup +} +echo_banner "devcontainer.community" +echo "Installing $binaryName..." +install "$@" +echo "(*) Done!" diff --git a/test/dotenv.org/test.sh b/test/dotenv.org/test.sh new file mode 100644 index 0000000..0aa9c4b --- /dev/null +++ b/test/dotenv.org/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib +# Provides the 'check' and 'reportResults' commands. +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. Syntax is... +# check