Skip to content

Commit d10303d

Browse files
πŸ€·πŸ»β€β™‚οΈ
1 parent db0eb35 commit d10303d

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

β€Žsrc/shellcheck/devcontainer-feature.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
],
1313
"default": "os-provided",
1414
"description": "Select or enter a ShellCheck version."
15+
},
16+
"installPath": {
17+
"type": "string",
18+
"default": "/usr/local/bin",
19+
"description": "The path where ShellCheck will be installed."
1520
}
1621
},
1722
"installsAfter": [

β€Žsrc/shellcheck/install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
set -e
44

55
SHELLCHECK_VERSION="${VERSION:-"os-provided"}"
66
INSTALL_PATH="${INSTALLPATH:-"/usr/local/bin"}"
77

8-
if [[ "$(id -u)" -ne 0 ]]; then
8+
if [ "$(id -u)" -ne 0 ]; then
99
printf 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
1010
exit 1
1111
fi
1212

1313

14-
if [[ "${SHELLCHECK_VERSION}" = "os-provided" ]]; then
14+
if [ "${SHELLCHECK_VERSION}" = "os-provided" ]; then
1515
apt update --yes
1616
apt install --no-install-recommends --yes shellcheck
1717

@@ -27,7 +27,7 @@ if ! type curl >/dev/null 2>&1; then
2727
curl_installed="true"
2828
fi
2929

30-
if [[ "${SHELLCHECK_VERSION}" = "latest" ]]; then
30+
if [ "${SHELLCHECK_VERSION}" = "latest" ]; then
3131
SHELLCHECK_VERSION="$(curl -s --head https://github.com/koalaman/shellcheck/releases/latest | sed -nr 's/location:.*\/v(.+)/\1/ip' | tr -d '\r')"
3232
fi
3333

@@ -47,6 +47,6 @@ url="https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERS
4747

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

50-
if [[ -n "${curl_installed}" ]]; then
50+
if [ -n "${curl_installed}" ]; then
5151
apt purge curl --autoremove --yes
5252
fi

β€Žtest/shellcheck/scenarios.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"shellcheck-version": {
3-
"image": "mcr.microsoft.com/devcontainers/base:debian",
3+
"image": "debian:latest",
44
"features": {
55
"shellcheck": {
6-
"version": "0.7.0"
6+
"version": "0.8.0"
77
}
88
}
99
},
1010

1111
"shellcheck-install-path": {
12-
"image": "mcr.microsoft.com/devcontainers/base:debian",
12+
"image": "debian:latest",
1313
"features": {
1414
"shellcheck": {
1515
"installPath": "/usr/bin"

β€Žtest/shellcheck/shellcheck-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source dev-container-features-test-lib
1111
# Feature-specific tests
1212
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
1313
# check <LABEL> <cmd> [args...]
14-
check "version" bash -c "shellcheck --version | grep 0.7.0"
14+
check "version" bash -c "shellcheck --version | grep 0.8.0"
1515

1616
# Report result
1717
# If any of the checks above exited with a non-zero exit code, the test will fail.

0 commit comments

Comments
Β (0)