giuliov / hugo-vsts-extension

Generate a site using Hugo, a Fast and Flexible Website Generator, running in Visual Studio Team Services or Team Foundation Server.
MIT License
24 stars 15 forks source link

Task fails with Hugo v0.93.0 #23

Open ArnoPeters opened 2 years ago

ArnoPeters commented 2 years ago

A hardcoded flag --i18n-warnings is set in HugoTask.ts (v2, line 44), which has been renamed in Hugo version 0.93.0 to printI18nWarnings. This breaks the build as I cannot overwrite or omit this parameter from the task. Discovered because my build was set to use "latest" Hugo version.

See https://github.com/gohugoio/hugo/releases/tag/v0.93.0

bjornbouetsmith commented 2 years ago

I can confirm this.

I did not change any settings in the plugin when I initially installed it.

So perhaps a way to "fix" this going forward is to "hardcode" the version in the plugin, so it uses the version that was "latest" when the version of this task built - so if people want to experiement, then they can actively change it to latest or a specific newer version?

ArnoPeters commented 2 years ago

I would rather that the no hardcoded parameters are used in the call to hugo.exe at all, but that they can be toggled by a flag which can be disabled. I don't mind if the default is true, but if I can disable them I can then always overwrite them with a custom parameter. This also prevents the task from going obsolete or users having to monitor every hugo release.

I have now solved my build issue by sending in a specific version requirement into the plugin.

johlju commented 2 years ago

I temporarily worked around it by moving back to 0.92.2.

- task: giuliovdev.hugo-extension.hugo-build-task-v2.HugoTask@2
  displayName: 'Generate Hugo site'
  inputs:
    destination: '$(Build.ArtifactStagingDirectory)'
    hugoVersion: 0.92.2
theperiscope commented 2 years ago

@johlju I have same issue and used your fix. I also left a comment for the Hugo developer to consider marking options as obsolete for certain amount of time to avoid breaking issues like this. https://github.com/gohugoio/hugo/commit/837fdfdf45014e3d5ef3b00b01548b68a4489c5f

Raph-Y commented 2 years ago

I ended up forking this repo and publishing a fixed version of the extension here: https://marketplace.visualstudio.com/items?itemName=MrCSharp.hugo-build-task-azure-devops

Credit is given to the author of this repo but I had to fork it because I couldn't wait for the PR to be merged.

Again, all credit to the author of this repo.