cleaned up stylegen

This commit is contained in:
2025-01-04 21:10:51 -07:00
parent f32ba4faf6
commit 62791490f6
7 changed files with 65 additions and 58 deletions

View File

@ -1,4 +1,7 @@
#!/bin/bash
#!/run/current-system/sw/bin/bash
# Define the version of the binary to download
VERSION="v1.7.27"
# Parse command-line arguments
while [[ $# -gt 0 ]]; do
@ -62,23 +65,35 @@ esac
echo "Detected OS: $OS"
echo "Detected Architecture: $ARCH"
# Use tw directory in script location
BINARY="${SCRIPT_DIR}/tw/${OS}-${ARCH}"
if [ "$OS" = "windows" ]; then
BINARY="${BINARY}.exe"
fi
# Function to construct the binary download URL based on version, OS, and architecture
get_binary_url() {
echo "https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/$VERSION/tailwindcss-extra-$OS-$ARCH"
}
echo "Looking for binary at: $BINARY"
# Create the 'tw' directory for storing the downloaded binary
TW_DIR="${SCRIPT_DIR}/tw"
mkdir -p "$TW_DIR"
# Check if binary exists
# Set the binary path
BINARY="${TW_DIR}/tailwindcss-extra-${OS}-${ARCH}"
# Check if the binary is already downloaded, otherwise download it
if [ ! -f "$BINARY" ]; then
echo "Binary not found: $BINARY"
echo "Contents of ${SCRIPT_DIR}/tw/:"
ls -la "${SCRIPT_DIR}/tw/"
echo "Binary not found, downloading version $VERSION..."
DOWNLOAD_URL=$(get_binary_url)
if [ -z "$DOWNLOAD_URL" ]; then
echo "No suitable release found for this OS and architecture."
exit 1
fi
# Download the binary
curl -L "$DOWNLOAD_URL" -o "$BINARY"
echo "Downloaded binary to: $BINARY"
fi
# Make binary executable
# Make the binary executable
chmod +x "$BINARY"
echo "Using binary: $BINARY"

Binary file not shown.

Binary file not shown.

Binary file not shown.