Skip to content

Commit c431314

Browse files
Copilotsebst
andauthored
Add jonas-tig feature (#250)
* Initial plan * feat: add jonas-tig feature (apt-based install) Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/297cb33d-553c-4eec-9c77-d957e9a44889 Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sebst <592313+sebst@users.noreply.github.com>
1 parent ab649fd commit c431314

5 files changed

Lines changed: 88 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
| [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 |
5757
| [jnsahaj/lumen](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jnsahaj-lumen) | `lumen` — AI-powered commit message generator | cargo | 1.0.0 |
5858
| [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 |
59+
| [jonas/tig](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jonas-tig) | `tig` — text-mode interface for Git | apt | 1.0.0 |
5960
| [jq](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jq) | `jq` — command-line JSON processor | apt | 1.0.0 |
6061
| [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 |
6162
| [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 |

src/jonas-tig/NOTES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# jonas/tig
2+
3+
## Project
4+
5+
- [jonas/tig](https://jonas.github.io/tig/)
6+
7+
## Description
8+
9+
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.
10+
11+
## Installation Method
12+
13+
Installed via the system APT package manager (`apt-get install tig`).
14+
15+
## Other Notes
16+
17+
_No additional notes._
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "jonas/tig",
3+
"id": "jonas-tig",
4+
"version": "1.0.0",
5+
"description": "Install \"tig\" binary",
6+
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jonas-tig",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"default": "latest",
11+
"proposals": [
12+
"latest"
13+
],
14+
"description": "Currently unused. tig is installed via the system package manager."
15+
}
16+
}
17+
}

src/jonas-tig/install.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o pipefail
4+
set -o noclobber
5+
set -o nounset
6+
set -o allexport
7+
readonly name="tig"
8+
apt_get_update() {
9+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
10+
echo "Running apt-get update..."
11+
apt-get update -y
12+
fi
13+
}
14+
apt_get_checkinstall() {
15+
if ! dpkg -s "$@" >/dev/null 2>&1; then
16+
apt_get_update
17+
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@"
18+
fi
19+
}
20+
apt_get_cleanup() {
21+
apt-get clean
22+
rm -rf /var/lib/apt/lists/*
23+
}
24+
echo_banner() {
25+
local text="$1"
26+
echo -e "\e[1m\e[97m\e[41m$text\e[0m"
27+
}
28+
install() {
29+
apt_get_checkinstall tig
30+
apt_get_cleanup
31+
}
32+
echo_banner "devcontainer.community"
33+
echo "Installing $name..."
34+
install "$@"
35+
echo "(*) Done!"

test/jonas-tig/test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
4+
set -e
5+
6+
# Optional: Import test library bundled with the devcontainer CLI
7+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
8+
# Provides the 'check' and 'reportResults' commands.
9+
source dev-container-features-test-lib
10+
11+
# Feature-specific tests
12+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13+
# check <LABEL> <cmd> [args...]
14+
check "execute command" bash -c "tig --version | grep 'tig version'"
15+
16+
# Report results
17+
# If any of the checks above exited with a non-zero exit code, the test will fail.
18+
reportResults

0 commit comments

Comments
 (0)