Reset project
This commit is contained in:
41
Makefile
41
Makefile
@@ -1,18 +1,27 @@
|
||||
TARGET = ./site
|
||||
.PHONY: dev build
|
||||
|
||||
.PHONY: clean distclean test components $(TARGET)
|
||||
dev:
|
||||
@if command -v $(HOME)/go/bin/air > /dev/null; then \
|
||||
AIR_CMD="$(HOME)/go/bin/air"; \
|
||||
elif command -v air > /dev/null; then \
|
||||
AIR_CMD="air"; \
|
||||
else \
|
||||
read -p "air is not installed. Install it? [Y/n] " choice; \
|
||||
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
|
||||
echo "Installing..."; \
|
||||
go install github.com/air-verse/air@latest; \
|
||||
AIR_CMD="$(HOME)/go/bin/air"; \
|
||||
else \
|
||||
echo "Exiting..."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
echo "Starting Air..."; \
|
||||
$$AIR_CMD
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
$(TARGET): components
|
||||
$(info ===> BUILD site)
|
||||
@go build ./cmd/site
|
||||
|
||||
components:
|
||||
$(info ===> BUILD templates)
|
||||
cd web/components && templ generate
|
||||
|
||||
clean:
|
||||
$(info ===> CLEAN)
|
||||
@go clean
|
||||
@rm -f $(TARGET)
|
||||
build:
|
||||
@echo "Generate Tailwind CSS..."
|
||||
go generate
|
||||
@echo "Building Go server..."
|
||||
go build -o tmp/server main.go
|
||||
@echo "Build complete."
|
||||
|
Reference in New Issue
Block a user