summaryrefslogtreecommitdiff
path: root/branding/templates/snap/generate.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2019-08-07 22:49:24 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2019-08-07 23:03:45 +0200
commitdbe330b8796ca9f403b5d5fe2133726ba504a803 (patch)
treea7b0ff095ebf574239719b316af0b204fad0b312 /branding/templates/snap/generate.py
parentcefd0857d1f6d798fedd2e6495a026d0b1de936b (diff)
[pkg] missing snap boilerplate
Diffstat (limited to 'branding/templates/snap/generate.py')
-rwxr-xr-xbranding/templates/snap/generate.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/branding/templates/snap/generate.py b/branding/templates/snap/generate.py
index 41d563d..b5ca641 100755
--- a/branding/templates/snap/generate.py
+++ b/branding/templates/snap/generate.py
@@ -13,15 +13,20 @@ from string import Template
TEMPLATE = 'snapcraft-template.yaml'
SNAPCRAFT = 'snapcraft.yaml'
-
here = os.path.split(os.path.realpath(__file__))[0]
data = json.load(open(os.path.join(here, 'data.json')))
+DESKTOP_TEMPLATE = 'local/app.desktop'
+DESKTOP = 'local/{}.desktop'.format(data['binaryName'])
template = Template(open(TEMPLATE).read())
-
with open(SNAPCRAFT, 'w') as output:
output.write(template.safe_substitute(data))
+template = Template(open(DESKTOP_TEMPLATE).read())
+with open(DESKTOP, 'w') as output:
+ output.write(template.safe_substitute(data))
+os.remove(DESKTOP_TEMPLATE)
+
print("[+] Snapcraft spec written to {path}".format(
path=os.path.abspath(SNAPCRAFT)))