-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Check if templ and tailwindcss commands are available before #296
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,14 @@ | |
|
||
# Build the application | ||
all: build | ||
{{if or ( .AdvancedOptions.htmx ) ( .AdvancedOptions.tailwind )}} | ||
|
||
build: | ||
check: | ||
@command -v templ >/dev/null 2>&1 || { echo >&2 "templ is not installed. Run 'go install go install github.com/a-h/templ/cmd/templ@latest' to install it or check your environment."; exit 1; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about adding an option to install tmpl, similar to what I proposed in your open issue ticket? |
||
@command -v tailwindcss >/dev/null 2>&1 || { echo >&2 "tailwindcss is not install. Go to https://tailwindcss.com/docs/installation to install it or check your environment."; exit 1; } | ||
|
||
{{end}} | ||
build:{{if or ( .AdvancedOptions.htmx ) ( .AdvancedOptions.tailwind )}} check{{end}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should restrict |
||
@echo "Building..." | ||
{{if or ( .AdvancedOptions.htmx ) ( .AdvancedOptions.tailwind )}}@templ generate{{end}} | ||
{{if .AdvancedOptions.tailwind}}@tailwindcss -i cmd/web/assets/css/input.css -o cmd/web/assets/css/output.css{{end}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If htmx flag is used, only the tmpl
check
is needed. If tailwind is used, it will automatically include the htmx flag in the project, so the tmpl and htmxcheck
need to be templated together.