hugo-vsts-extension icon indicating copy to clipboard operation
hugo-vsts-extension copied to clipboard

Task fails with Hugo v0.93.0

Open ArnoPeters opened this issue 4 years ago • 5 comments

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

ArnoPeters avatar Mar 01 '22 07:03 ArnoPeters

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?

bjornbouetsmith avatar Mar 02 '22 10:03 bjornbouetsmith

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.

ArnoPeters avatar Mar 02 '22 10:03 ArnoPeters

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

johlju avatar Mar 23 '22 16:03 johlju

@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

theperiscope avatar Apr 30 '22 22:04 theperiscope

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.

Raph-Y avatar Sep 12 '22 01:09 Raph-Y