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

feat: Check Hugo installed hugo version before serve #600

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bupd
Copy link
Contributor

@bupd bupd commented Nov 15, 2024

Summary

TLDR; We need better error message when our local hugo version is wrong.

Changes made

  • Check if the correct Hugo version is installed before running serve
  • Add .tool-versions to .gitignore to exclude asdf-managed version file

Description

I’ve seen a recurring issue that wastes a lot of time when working on multiple OSS projects with different Hugo versions. Often, the app doesn’t compile correctly, and instead of a clear error, we get misleading messages. This leads to a frustrating cycle of fixing one error only to encounter another, sometimes wasting 40-70 minutes before realizing the issue is simply using the wrong version of Hugo.

Here's a screenshot of the misleading error caused by the wrong Hugo version: (misleading right).

hugo version err

the error messages doesn't clearly mention the correct version to use.

* Adds checking of current hugo version installed
* checks the current hugo version installed and verifies if the correct
hugo version required is installed before serve.
* adds .tool-versions to gitignore - an autogenerated file by asdf.

Signed-off-by: bupd <[email protected]>
@bupd bupd requested review from a team as code owners November 15, 2024 11:20
@OrlinVasilev
Copy link
Member

hi @bupd thanks for the PR, is that required by some issue that you have faced or ?

@bupd
Copy link
Contributor Author

bupd commented Nov 21, 2024

Yes, I have updated the description @OrlinVasilev

@Vad1mo Vad1mo enabled auto-merge (squash) December 24, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants