Skip to content
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

[Feature Request] Check if templ and tailwindcss are installed in the Makefile #295

Closed
1 task done
jaswdr opened this issue Aug 24, 2024 · 2 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@jaswdr
Copy link

jaswdr commented Aug 24, 2024

Tell us about your feature request

When I tried to build my first project using Blueprint I noticed that the generated Makefile is assuming that the system has templ and tailwindcss installed locally. This was not true in my case, and I believe that this could happen with more people, so I think it would be nice to add a step before the build to check if both are installed, and if not, redirect the user to the right place to install them.

Disclaimer

  • I agree
@jaswdr jaswdr added the enhancement New feature or request label Aug 24, 2024
jaswdr added a commit to jaswdr/go-blueprint that referenced this issue Aug 24, 2024
@Ujstor
Copy link
Collaborator

Ujstor commented Aug 24, 2024

I opened ticket #275 with the same intention :) The tmpl one is simple, but Tailwind needs a little more work.

There is a checkOS function in program.go that can return whether we are running a Windows or Unix-like OS. Expanding the checkOS function to verify if we are on Windows, Linux, or Darwin can solve complexities with Makefile templating.

@if command -v templ > /dev/null; then \
			templ generate; \
	else \
		read -p "Go's 'templ' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
		if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
			go install github.com/a-h/templ/cmd/templ@latest; \
			templ generate; \
		else \
			echo "You chose not to install templ. Exiting..."; \
			exit 1; \
		fi; \
	fi

@Ujstor Ujstor mentioned this issue Sep 16, 2024
2 tasks
@Ujstor Ujstor self-assigned this Sep 16, 2024
@Ujstor
Copy link
Collaborator

Ujstor commented Sep 18, 2024

Resolved in #306

@Ujstor Ujstor closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants