diff --git a/README.md b/README.md index 131ff62..f3ab8ea 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ | [jj-vcs.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jj-vcs.dev) | `jj` — Git-compatible distributed VCS | gh release | 1.0.2 | | [jnsahaj/lumen](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jnsahaj-lumen) | `lumen` — AI-powered commit message generator | cargo | 1.0.0 | | [joelhooks/agent-secrets](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/joelhooks-agent-secrets) | `secrets` — manage secrets for AI agents | gh release | 1.0.1 | +| [jonas/tig](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jonas-tig) | `tig` — text-mode interface for Git | apt | 1.0.0 | | [jq](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jq) | `jq` — command-line JSON processor | apt | 1.0.0 | | [k9scli.io](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/k9scli.io) | `k9s` — terminal UI for Kubernetes clusters | gh release | 1.0.1 | | [keybase.io](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/keybase.io) | `keybase` — cryptographic identity and encrypted file sharing | curl | 1.2.0 | diff --git a/src/jonas-tig/NOTES.md b/src/jonas-tig/NOTES.md new file mode 100644 index 0000000..f3abdff --- /dev/null +++ b/src/jonas-tig/NOTES.md @@ -0,0 +1,17 @@ +# jonas/tig + +## Project + +- [jonas/tig](https://jonas.github.io/tig/) + +## Description + +A text-mode interface for Git. `tig` allows you to browse and interact with Git repositories from the terminal, providing a curses-based UI for common Git operations. + +## Installation Method + +Installed via the system APT package manager (`apt-get install tig`). + +## Other Notes + +_No additional notes._ diff --git a/src/jonas-tig/devcontainer-feature.json b/src/jonas-tig/devcontainer-feature.json new file mode 100644 index 0000000..a69b379 --- /dev/null +++ b/src/jonas-tig/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "name": "jonas/tig", + "id": "jonas-tig", + "version": "1.0.0", + "description": "Install \"tig\" binary", + "documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jonas-tig", + "options": { + "version": { + "type": "string", + "default": "latest", + "proposals": [ + "latest" + ], + "description": "Currently unused. tig is installed via the system package manager." + } + } +} diff --git a/src/jonas-tig/install.sh b/src/jonas-tig/install.sh new file mode 100755 index 0000000..ccd29ad --- /dev/null +++ b/src/jonas-tig/install.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o noclobber +set -o nounset +set -o allexport +readonly name="tig" +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" +} +install() { + apt_get_checkinstall tig + apt_get_cleanup +} +echo_banner "devcontainer.community" +echo "Installing $name..." +install "$@" +echo "(*) Done!" diff --git a/test/jonas-tig/test.sh b/test/jonas-tig/test.sh new file mode 100755 index 0000000..dfe5e4a --- /dev/null +++ b/test/jonas-tig/test.sh @@ -0,0 +1,18 @@ +#!/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