Skip to content

Instantly share code, notes, and snippets.

@FieryCod
Created January 18, 2025 11:50
Show Gist options
  • Save FieryCod/c27f9618ca0cee594262e814ac0ccee9 to your computer and use it in GitHub Desktop.
Save FieryCod/c27f9618ca0cee594262e814ac0ccee9 to your computer and use it in GitHub Desktop.
No root installation of clj-fmt for Docker
#!/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