From 57fad69fc90bfeb343d8ff8727afc64f45114cf7 Mon Sep 17 00:00:00 2001 From: Lyon Till Date: Tue, 4 Feb 2025 21:46:07 +0000 Subject: [PATCH] fix: remove mkcert tool --- src/mkcert/README.md | 24 ------------- src/mkcert/devcontainer-feature.json | 15 -------- src/mkcert/install.sh | 51 ---------------------------- test/mkcert/scenarios.json | 11 ------ test/mkcert/test.sh | 12 ------- test/mkcert/version.sh | 15 -------- 6 files changed, 128 deletions(-) delete mode 100644 src/mkcert/README.md delete mode 100644 src/mkcert/devcontainer-feature.json delete mode 100644 src/mkcert/install.sh delete mode 100644 test/mkcert/scenarios.json delete mode 100644 test/mkcert/test.sh delete mode 100644 test/mkcert/version.sh diff --git a/src/mkcert/README.md b/src/mkcert/README.md deleted file mode 100644 index bd3b3ef..0000000 --- a/src/mkcert/README.md +++ /dev/null @@ -1,24 +0,0 @@ - -# mkcert (mkcert) - -Command line tool (mkcert) - -## Example Usage - -```json -"features": { - "ghcr.io/ljtill/features/mkcert:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| -| version | Select version of mkcert | string | latest | - - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/ljtill/features/blob/main/src/mkcert/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/mkcert/devcontainer-feature.json b/src/mkcert/devcontainer-feature.json deleted file mode 100644 index 87d7d27..0000000 --- a/src/mkcert/devcontainer-feature.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "mkcert", - "version": "1.0.0", - "name": "mkcert", - "description": "Command line tool (mkcert)", - "documentationURL": "https://mkcert.dev", - "options": { - "version": { - "type": "string", - "description": "Select version of mkcert", - "default": "latest" - } - }, - "customizations": {} -} diff --git a/src/mkcert/install.sh b/src/mkcert/install.sh deleted file mode 100644 index b20c4cc..0000000 --- a/src/mkcert/install.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -set -e - -cd "$(mktemp -d)" - -check() { - if ! dpkg -s "$@" > /dev/null 2>&1; then - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt update..." - apt update -y - fi - apt -y install --no-install-recommends "$@" - fi -} - -export DEBIAN_FRONTEND=noninteractive - -check curl ca-certificates jq - -version() { - if [ "${VERSION}" = "latest" ]; then - URL="https://api.github.com/repos/FiloSottile/mkcert/releases/latest" - if ! curl -sLf -o ./response.json "$URL"; then - echo "ERROR: Unable to fetch latest version" - exit 1 - fi - export VERSION=$(cat ./response.json | jq -r ".tag_name" | sed 's/v//') - else - export VERSION=$(echo ${VERSION} | sed 's/v//') - fi -} - -download() { - URL="https://github.com/FiloSottile/mkcert/releases/download/v"${VERSION}"/mkcert-v"${VERSION}"-linux-amd64" - if ! curl -sLf -o ./mkcert-v"${VERSION}"-linux-amd64 "$URL"; then - echo "ERROR: Unable to download file" - exit 1 - fi -} - -install() { - chmod +x ./mkcert-v"${VERSION}"-linux-amd64 - chown root:root ./mkcert-v"${VERSION}"-linux-amd64 - mv ./mkcert-v"${VERSION}"-linux-amd64 /usr/local/bin/mkcert -} - -echo "Activating feature 'mkcert'" - -version -download -install diff --git a/test/mkcert/scenarios.json b/test/mkcert/scenarios.json deleted file mode 100644 index f076131..0000000 --- a/test/mkcert/scenarios.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": { - "image": "mcr.microsoft.com/devcontainers/base:debian", - "user": "vscode", - "features": { - "mkcert": { - "version": "1.4.4" - } - } - } -} diff --git a/test/mkcert/test.sh b/test/mkcert/test.sh deleted file mode 100644 index 3b0daf8..0000000 --- a/test/mkcert/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -# Import test library -source dev-container-features-test-lib - -# Feature-specific tests -check "version" mkcert --version - -# Report result -reportResults diff --git a/test/mkcert/version.sh b/test/mkcert/version.sh deleted file mode 100644 index 8f02791..0000000 --- a/test/mkcert/version.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -# Import test library -source dev-container-features-test-lib - -# Check the user -check "vscode" whoami | grep vscode - -# Options-specific tests -check "version" mkcert --version | grep "1.4.4" - -# Report result -reportResults