diff options
author | Anthony Fok <[email protected]> | 2022-08-29 23:14:22 -0600 |
---|---|---|
committer | Anthony Fok <[email protected]> | 2022-08-29 23:14:22 -0600 |
commit | e0ba1a805aaa0d0e8ca2563c498722abb2851293 (patch) | |
tree | 4bf1302697cbbb621ffb491e5485797e34340978 /snap/snapcraft.yaml | |
parent | 7b49c56a6a916bc6586ac558a54a2c7616430bbb (diff) | |
download | hugo-e0ba1a805aaa0d0e8ca2563c498722abb2851293.tar.gz hugo-e0ba1a805aaa0d0e8ca2563c498722abb2851293.zip |
snap: Use "snapcraftctl set-version"
This allows the use of "git describe --tags" to recognize lightweight
version tags, and the removal of initial "v" in the hugo snap version.
See #10225
Diffstat (limited to 'snap/snapcraft.yaml')
-rw-r--r-- | snap/snapcraft.yaml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8bf0126c5..64083bcc4 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,4 @@ name: hugo -version: git issues: https://github.com/gohugoio/hugo/issues source-code: https://github.com/gohugoio/hugo.git website: https://gohugo.io/ @@ -12,6 +11,7 @@ license: "Apache-2.0" base: core20 confinement: strict grade: devel # "devel" or "stable" +adopt-info: hugo package-repositories: - type: apt @@ -77,6 +77,9 @@ parts: after: - git - go + override-pull: | + snapcraftctl pull + snapcraftctl set-version "$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')" override-build: | echo "\nStarting override-build:" set -ex |