snap: Add bash completion
authorAnthony Fok <foka@debian.org>
Thu, 5 Apr 2018 13:15:51 +0000 (07:15 -0600)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 5 Apr 2018 13:51:11 +0000 (15:51 +0200)
snapcraft.yaml

index 4cb57004e91f09a3ef2181ec753b2141e31f2d1d..821a91c9466c135896ae776c68346bed1f481ff3 100644 (file)
@@ -11,6 +11,7 @@ grade: devel # "devel" or "stable"
 apps:
   hugo:
     command: bin/hugo
+    completer: hugo-completion
     plugs: [home, network-bind, removable-media]
 
 parts:
@@ -34,10 +35,12 @@ parts:
       export PATH=$GOPATH/bin:$PATH
       [ "$SNAPCRAFT_PROJECT_GRADE" = "stable" ] && mage hugoNoGitInfo || mage hugo
       ./hugo version
+      ./hugo gen autocomplete --completionfile=hugo-completion
     install: |
       install -d $SNAPCRAFT_PART_INSTALL/bin
       cp -a hugo $SNAPCRAFT_PART_INSTALL/bin/hugo
       strip --remove-section=.comment --remove-section=.note $SNAPCRAFT_PART_INSTALL/bin/hugo
+      mv hugo-completion $SNAPCRAFT_PART_INSTALL/hugo-completion
     after: [go]
   go:
     source-tag: go1.10