This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathsample-answers.js
73 lines (69 loc) · 1.96 KB
/
sample-answers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
'use strict';
// localmodules
var bowerConfig = require('./bower-config.js');
module.exports = {
standard: {
appModule: 'myProject', // include appModule here, so it's easier to test for it!
appName: 'My Project',
appId: 'com.company.project',
bowerPackages: (function () { // list all packages from the bower-config optional list
var packages = [];
for (var i = 0, component; ((component = bowerConfig.optional[i])); i++) {
if (component.value) {
packages.push(component.value);
}
}
return packages;
})(),
ionicCss: true,
install: 'yarn',
platforms: [
'ios',
'android',
'browser'
],
plugins: [
'cordova-plugin-device',
'cordova-plugin-dialogs',
'ionic-plugin-keyboard'
],
template: 'tabs',
ecosystems: ['greenhouse']
},
/**
* return a copy of the standard answers
* @return {object}
*/
getStandard: function (options) {
var standardCopy = JSON.parse(JSON.stringify(this.standard));
if (options && options['ios-only']) {
standardCopy.platforms = ['ios'];
}
if (options && options['android-only']) {
standardCopy.platforms = ['android'];
}
if (options && options.cordova === false) {
standardCopy.platforms = [];
standardCopy.plugins = [];
}
if (options && options.ionicCss !== undefined) {
standardCopy.ionicCss = options.ionicCss;
}
if (options && options.localforage === false) {
var bowerPackages = standardCopy.bowerPackages.filter(function (value) {
return value.indexOf('localforage') === -1;
});
standardCopy.bowerPackages = bowerPackages;
}
if (options && options['ionic-cloud']) {
standardCopy.ecosystems.push('ionic-cloud');
}
return standardCopy;
},
getForAppNameOption: function () {
var standard = this.getStandard();
delete standard.appName;
delete standard.appModule;
return standard;
}
};