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
Member

@bupd bupd commented Nov 15, 2024

Summary

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

* 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
Member Author

bupd commented Nov 21, 2024

is that required by some issue that you have faced or ?

Yes @OrlinVasilev , I’ve seen a recurring issue that wastes a lot of time when working on 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.

This problem is especially common when the latest version of Hugo is globally installed, but projects like Harbor require an older extended version. Even though we specify the Hugo version in the netlify.toml file, many developers overlook this step, which leads to confusion and wasted time.

The error messages we receive when using the wrong version are unclear, and this needs to be addressed to make the process smoother for everyone. And For new contributors, setting up the project locally should be simple and hassle-free, as this is often the toughest part of getting started.

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.

@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