Set tailwindcss binary file name depending on current os (#125)

* Download tailwindcss arm64 binary if on macOS

* add tailwind binary download for macos x64 or arm64
This commit is contained in:
Paulo Chaves 2025-07-18 09:51:44 -03:00 committed by GitHub
parent fd6218c0ad
commit 2eefb46e08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,22 @@
# The Tailwind CSS CLI package to install (pick the one that matches your OS: https://github.com/tailwindlabs/tailwindcss/releases/latest)
TAILWIND_PACKAGE = tailwindcss-linux-x64
# Get the OS name in lowercase (linux, darwin)
OS_SYSNAME := $(shell uname -s | tr A-Z a-z)
# Get the machine architecture (x86_64, arm64)
OS_MACHINE := $(shell uname -m)
# If mac OS, use `macos-arm64` or `macos-x64`
ifeq ($(OS_SYSNAME),darwin)
OS_SYSNAME = macos
ifneq ($(OS_MACHINE),arm64)
OS_MACHINE = x64
endif
endif
# If Linux, use `linux-x64`
ifeq ($(OS_SYSNAME),linux)
OS_MACHINE = x64
endif
TAILWIND_PACKAGE = tailwindcss-$(OS_SYSNAME)-$(OS_MACHINE)
.PHONY: help
help: ## Print make targets
@ -59,4 +76,4 @@ css: ## Build and minify Tailwind CSS
.PHONY: build
build: css ## Build CSS and compile the application binary
go build -o ./tmp/main ./cmd/web
go build -o ./tmp/main ./cmd/web