Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- github.com-cli
- helix-editor.com
- jj-vcs.dev
- jq
- k9scli.io
- mosh.org
- keybase.io
Expand Down Expand Up @@ -86,6 +87,7 @@ jobs:
- github.com-cli
- helix-editor.com
- jj-vcs.dev
- jq
- k9scli.io
- mosh.org
- keybase.io
Expand Down
25 changes: 25 additions & 0 deletions src/jq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# jq (jq)

Install "jq" binary

## Example Usage

```json
"features": {
"ghcr.io/devcontainer-community/devcontainer-features/jq:1": {}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Currently unused. jq is installed via the system package manager. | string | latest |




---

_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainer-community/devcontainer-features/blob/main/src/jq/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
17 changes: 17 additions & 0 deletions src/jq/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "jq",
"id": "jq",
"version": "1.0.0",
"description": "Install \"jq\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/jq",
"options": {
"version": {
"type": "string",
"default": "latest",
"proposals": [
"latest"
],
"description": "Currently unused. jq is installed via the system package manager."
}
}
}
35 changes: 35 additions & 0 deletions src/jq/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -o errexit
set -o pipefail
set -o noclobber
set -o nounset
set -o allexport
readonly name="jq"
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 jq
apt_get_cleanup
}
echo_banner "devcontainer.community"
echo "Installing $name..."
install "$@"
echo "(*) Done!"
18 changes: 18 additions & 0 deletions test/jq/test.sh
Original file line number Diff line number Diff line change
@@ -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 <LABEL> <cmd> [args...]
check "execute command" bash -c "jq --version | grep 'jq'"

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults
Loading