diff options
author | Anthony Fok <foka@debian.org> | 2018-04-05 07:14:51 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-05 15:51:11 +0200 |
commit | 294c0f8001fe598278c1eb8015deb6b98e8de686 (patch) | |
tree | 89e6254e2bc7cbfe767741639adc2fe214396ef6 /snapcraft.yaml | |
parent | a4deaeff0cfd70abfbefa6d40c0b86839a216f6d (diff) |
snap: Fix empty BuildDate in "hugo version"
Previously, "snap run hugo version" returns an empty BuildDate like so:
Hugo Static Site Generator v0.38 linux/amd64 BuildDate:
Fix by overriding the default build target of snapcraft's go plugin.
Diffstat (limited to 'snapcraft.yaml')
-rw-r--r-- | snapcraft.yaml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/snapcraft.yaml b/snapcraft.yaml index 53db668d0..4cb57004e 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -28,10 +28,15 @@ parts: export PATH=$GOPATH/bin:$PATH cd $GOPATH/src/github.com/gohugoio/hugo go get github.com/magefile/mage - mage -v vendor test - rm -f $GOPATH/bin/dep - rm -f $GOPATH/bin/mage + mage -v vendor check + build: | + export GOPATH=$(dirname $SNAPCRAFT_PART_INSTALL)/go + export PATH=$GOPATH/bin:$PATH + [ "$SNAPCRAFT_PROJECT_GRADE" = "stable" ] && mage hugoNoGitInfo || mage hugo + ./hugo version 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 after: [go] go: |