Merge lp:~sergiusens/snapcraft/init into lp:~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Merged
Approved by: Michael Vogt
Approved revision: 179
Merged at revision: 160
Proposed branch: lp:~sergiusens/snapcraft/init
Merge into: lp:~snappy-dev/snapcraft/core
Prerequisite: lp:~sergiusens/snapcraft/filesets
Diff against target: 28 lines (+13/-1)
1 file modified
snapcraft/cmds.py (+13/-1)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/init
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+270836@code.launchpad.net

Commit message

snapcraft init with templated values

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snapcraft/cmds.py'
2--- snapcraft/cmds.py 2015-09-07 18:02:13 +0000
3+++ snapcraft/cmds.py 2015-09-11 15:02:05 +0000
4@@ -31,11 +31,23 @@
5 logger = logging.getLogger(__name__)
6
7
8+_TEMPLATE_YAML = r'''name: # the name of the snap
9+version: # the version of the snap
10+# The vendor for the snap (replace 'Vendor <email@example.com>')
11+vendor: Vendor <email@example.com>
12+summary: # 79 char long summary
13+description: # A longer description for the snap
14+icon: # A path to an icon for the package
15+'''
16+
17+
18 def init(args):
19 if os.path.exists("snapcraft.yaml"):
20 logger.error('snapcraft.yaml already exists!')
21 sys.exit(1)
22- yaml = 'parts:\n'
23+ yaml = _TEMPLATE_YAML
24+ if args.part:
25+ yaml += 'parts:\n'
26 for part_name in args.part:
27 part = snapcraft.plugin.load_plugin(part_name, part_name, load_code=False)
28 yaml += ' ' + part.names()[0] + ':\n'

Subscribers

People subscribed via source and target branches