summaryrefslogtreecommitdiff
path: root/scripts/tailwind.setup.sh
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-01-20 14:02:34 +0530
committerBobby <[email protected]>2026-01-20 14:02:34 +0530
commit7fee36b4fbae90dacdecb917e262ad58927fe746 (patch)
tree3739af9bf8d2e78c6536a7dfa24ce391abb90ff1 /scripts/tailwind.setup.sh
parent61d5f45189a40621bceeb14c6646031dd15ab6c2 (diff)
downloadcafe-7fee36b4fbae90dacdecb917e262ad58927fe746.tar.xz
cafe-7fee36b4fbae90dacdecb917e262ad58927fe746.zip
Add Tailwind CSS and HTMX integration and implement custom template tags
Diffstat (limited to 'scripts/tailwind.setup.sh')
-rwxr-xr-xscripts/tailwind.setup.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/tailwind.setup.sh b/scripts/tailwind.setup.sh
new file mode 100755
index 0000000..f65cea6
--- /dev/null
+++ b/scripts/tailwind.setup.sh
@@ -0,0 +1,79 @@
+#!/usr/bin/env bash
+set -e
+
+TOOLCHAIN_DIR="toolchain"
+TAILWIND_BIN="$TOOLCHAIN_DIR/tailwind"
+
+echo "Detecting platform..."
+
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+ARCH=$(uname -m)
+
+case "$OS" in
+ linux*)
+ PLATFORM="linux"
+ ;;
+ darwin*)
+ PLATFORM="macos"
+ ;;
+ msys*|mingw*|cygwin*)
+ PLATFORM="windows"
+ ;;
+ *)
+ echo "Unsupported OS: $OS"
+ exit 1
+ ;;
+esac
+
+case "$ARCH" in
+ x86_64|amd64)
+ ARCHITECTURE="x64"
+ ;;
+ arm64|aarch64)
+ ARCHITECTURE="arm64"
+ ;;
+ armv7l)
+ ARCHITECTURE="armv7"
+ ;;
+ *)
+ echo "Unsupported architecture: $ARCH"
+ exit 1
+ ;;
+esac
+
+BINARY_NAME="tailwindcss-${PLATFORM}-${ARCHITECTURE}"
+
+echo "Platform: $PLATFORM"
+echo "Architecture: $ARCHITECTURE"
+echo "Binary: $BINARY_NAME"
+echo ""
+
+echo "Fetching latest Tailwind CSS release..."
+LATEST_RELEASE=$(curl -s https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
+
+if [ -z "$LATEST_RELEASE" ]; then
+ echo "Failed to fetch latest release"
+ exit 1
+fi
+
+echo "Latest version: $LATEST_RELEASE"
+DOWNLOAD_URL="https://github.com/tailwindlabs/tailwindcss/releases/download/${LATEST_RELEASE}/${BINARY_NAME}"
+
+echo "Downloading from: $DOWNLOAD_URL"
+echo ""
+
+mkdir -p "$TOOLCHAIN_DIR"
+
+if curl -fSL "$DOWNLOAD_URL" -o "$TAILWIND_BIN"; then
+ chmod +x "$TAILWIND_BIN"
+ echo ""
+ echo "Tailwind CSS installed successfully!"
+ echo "Location: $TAILWIND_BIN"
+ echo "Version: $($TAILWIND_BIN --help | head -n 1 || echo $LATEST_RELEASE)"
+else
+ echo ""
+ echo "Failed to download Tailwind CSS binary"
+ echo "Please check if the binary exists for your platform:"
+ echo "$DOWNLOAD_URL"
+ exit 1
+fi \ No newline at end of file