Created
January 18, 2025 11:50
-
-
Save FieryCod/c27f9618ca0cee594262e814ac0ccee9 to your computer and use it in GitHub Desktop.
No root installation of clj-fmt for Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
VERSION=0.13.0 | |
case $(uname -s) in | |
Linux*) | |
PLATFORM=linux | |
;; | |
Darwin*) | |
PLATFORM=darwin | |
;; | |
esac | |
STATIC= | |
case $(uname -m) in | |
aarch64) | |
ARCH=aarch64 | |
;; | |
arm64) | |
ARCH=aarch64 | |
;; | |
*) | |
ARCH=amd64 | |
if [[ "$PLATFORM" == "linux" ]]; then | |
STATIC="-static" | |
fi | |
;; | |
esac | |
BASE_URL="https://github.com/weavejester/cljfmt/releases/download" | |
URL="${BASE_URL}/${VERSION}/cljfmt-${VERSION}-${PLATFORM}-${ARCH}${STATIC}.tar.gz" | |
echo -n "Downloading cljfmt binaries... " | |
curl -o /tmp/cljfmt.tar.gz -sL "$URL" | |
echo "Done!" | |
tar -xzf /tmp/cljfmt.tar.gz -C /usr/local/bin | |
echo "Extracted cljfmt into /usr/local/bin" | |
rm /tmp/cljfmt.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment