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 939e1ceed5
commit eba3d5e105

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) # Get the OS name in lowercase (linux, darwin)
TAILWIND_PACKAGE = tailwindcss-linux-x64 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 .PHONY: help
help: ## Print make targets help: ## Print make targets
@ -59,4 +76,4 @@ css: ## Build and minify Tailwind CSS
.PHONY: build .PHONY: build
build: css ## Build CSS and compile the application binary build: css ## Build CSS and compile the application binary
go build -o ./tmp/main ./cmd/web go build -o ./tmp/main ./cmd/web