Browse Source

Add snapcraft.yaml to enable snap builds.

Dariusz Gadomski 2 years ago
parent
commit
8b3c668563
1 changed files with 28 additions and 0 deletions
  1. 28 0
      snap/snapcraft.yaml

+ 28 - 0
snap/snapcraft.yaml

@@ -0,0 +1,28 @@
+name: http-prompt
+summary: Interactive command-line HTTP client
+description: |
+  HTTP Prompt is an interactive command-line HTTP client featuring autocomplete
+  and syntax highlighting, built on HTTPie and prompt_toolkit.
+  Home: http://http-prompt.com
+adopt-info: http-prompt
+confinement: strict
+
+apps:
+    http-prompt:
+        command: bin/http-prompt
+        plugs: [ network ]
+parts:
+    http-prompt:
+        source: .
+        plugin: python
+        python-version: python2
+        override-pull: |
+            snapcraftctl pull
+            version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
+            case $version in
+                v*) version=$(echo $version | tail -c +2) ;;
+                *)  version=$(echo $version | head -c 32) ;;
+            esac
+            [ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
+            snapcraftctl set-version "$version"
+            snapcraftctl set-grade "$grade"