klakegg/docker-hugo

Shell completion broken

jwhittaker opened this issue · 0 comments

The gen autocomplete command was removed since hugo v0.92.2.

https://github.com/gohugoio/hugo/releases/tag/v0.92.2

Shelling into a container results in the /etc/bash_completion.d/hugo.sh file being the help text from hugo gen help.

The command changed to hugo completion bash.

I think this would be the change to fix auto completion:

diff --git a/src/files/_script/hugo-extended.sh b/src/files/_script/hugo-extended.sh
index ab9a885..0f1ba86 100644
--- a/src/files/_script/hugo-extended.sh
+++ b/src/files/_script/hugo-extended.sh
@@ -45,7 +45,7 @@ tar -zxf hugo-extended-${HUGO_VERSION}-linux-${HUGOGURU_ARCH}.tar.gz -C /files/u

 # Create autocompletion script
 mkdir -p /files/etc/bash_completion.d
-/files/usr/lib/hugo/hugo gen autocomplete > /files/etc/bash_completion.d/hugo.sh
+/files/usr/lib/hugo/hugo completion bash > /files/etc/bash_completion.d/hugo.sh

 # Create version file
 echo -n "${HUGO_VERSION}" > /files/etc/hugo-release
diff --git a/src/files/_script/hugo-standard.sh b/src/files/_script/hugo-standard.sh
index 0887508..6dc657e 100644
--- a/src/files/_script/hugo-standard.sh
+++ b/src/files/_script/hugo-standard.sh
@@ -40,7 +40,7 @@ tar -zxf hugo_${HUGO_VERSION}_Linux-${HUGO_ARCH}.tar.gz -C /files/usr/lib/hugo

 # Create autocompletion script
 mkdir -p /files/etc/bash_completion.d
-/files/usr/lib/hugo/hugo gen autocomplete > /files/etc/bash_completion.d/hugo.sh
+/files/usr/lib/hugo/hugo completion bash > /files/etc/bash_completion.d/hugo.sh

 # Create version file
 echo -n "${HUGO_VERSION}" > /files/etc/hugo-release

But I'm getting makefile errors and haven't tried further.