1 | var Manifest = require('../util/manifest');
|
2 | var log = require('../util/log');
|
3 | var validator = require('validator');
|
4 |
|
5 | module.exports = {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | getDesignId: function(arg1, arg2, man) {
|
19 | var id = arg1 || arg2;
|
20 |
|
21 | if (id) {
|
22 | if (!validator.isUUID(id)) return log.fail('The value specified for option -i is not a valid design ID', id);
|
23 | } else {
|
24 | var manifest = Manifest.get(man);
|
25 | if (!manifest || !manifest.id) return log.fail('No manifest found. Please supply design id using -i or change to a directory with a valid manifest file');
|
26 | id = manifest.id;
|
27 | }
|
28 | return id;
|
29 | }
|
30 | }
|