Skip to content

Commit

Permalink
Maybe xz-tools might not be installed
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber623-cargosense committed Feb 29, 2024
1 parent d10303d commit 7d790e1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
21 changes: 21 additions & 0 deletions src/redis-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# redis-cli

Install the [Redis command line utility](https://redis.io/docs/connect/cli/).

## Usage

```json
"features": {
"ghcr.io/CargoSense/devcontainer-features/redis-cli:1": {}
}
```

## Options

| Option ID | Description | Type | Default Value |
|:----------|:----------------------------------|:-------|:--------------|
| `version` | The redis-cli version to install. | string | `os-provided` |

## OS Support

This Feature should work on recent versions of Debian/Ubuntu and Linux distributions using the [apt](https://wiki.debian.org/AptCLI) management tool.
19 changes: 19 additions & 0 deletions src/redis-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Redis CLI",
"id": "redis-cli",
"version": "1.0.0",
"description": "Install the Redis command line utility.",
"options": {
"version": {
"type": "string",
"proposals": [
"os-provided"
],
"default": "os-provided",
"description": "Select or enter a Redis CLI version."
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
Empty file added src/redis-cli/install.sh
Empty file.
7 changes: 4 additions & 3 deletions src/shellcheck/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ curl_installed=""

if ! type curl >/dev/null 2>&1; then
apt update --yes
apt install --no-install-recommends --yes curl ca-certificates
apt install --no-install-recommends --yes curl ca-certificates xz-utils

curl_installed="true"
fi
Expand All @@ -43,10 +43,11 @@ case "${machine}" in
esac

# https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.aarch64.tar.xz
url="https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.${arch}.tar.xz"
file="shellcheck-v${SHELLCHECK_VERSION}.linux.${arch}.tar.xz"
url="https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/${file}"

curl -sSL "${url}" | tar --strip-components=1 -Jxvf - -C "${INSTALL_PATH}" "shellcheck-v${SHELLCHECK_VERSION}/shellcheck"

if [ -n "${curl_installed}" ]; then
apt purge curl --autoremove --yes
apt purge curl xz-utils --autoremove --yes
fi

0 comments on commit 7d790e1

Please sign in to comment.