Skip to content

Instantly share code, notes, and snippets.

@aarisr
Created March 18, 2025 17:33
Show Gist options
  • Save aarisr/75f23f9c2a844fcfe072931739ba4997 to your computer and use it in GitHub Desktop.
Save aarisr/75f23f9c2a844fcfe072931739ba4997 to your computer and use it in GitHub Desktop.
Install Editorconfig checker inside a container
#!/bin/sh
VERSION="v3.2.1"
# Detect OS
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
# Detect architecture
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
arm64|aarch64) ARCH="arm64" ;;
i386|i686) ARCH="386" ;;
*) echo "Unsupported architecture: $ARCH" && exit 1 ;;
esac
# Construct filename
FILENAME="ec-${OS}-${ARCH}.tar.gz"
URL="https://github.com/editorconfig-checker/editorconfig-checker/releases/download/${VERSION}/${FILENAME}"
curl -L "$URL" | tar -xz --strip-components=1 -C /usr/local/bin "bin/ec-${OS}-${ARCH}"
mv /usr/local/bin/ec-${OS}-${ARCH} /usr/local/bin/ec
chmod +x /usr/local/bin/ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment