cleaned up stylegen
This commit is contained in:
@ -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.
Reference in New Issue
Block a user