Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8723bb6

Browse files
committed
[ADD] config-parser: add getConfigFilesData method
1 parent 89ce484 commit 8723bb6

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

lib/config-parser.js

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var shell = require('shelljs'),
77

88
shell.config.silent = false;
99

10-
module.exports = function(_configJson, _process) {
10+
module.exports = function wrapperConfig(_configJson, _process) {
1111
'use strict';
1212
var configJson,
1313
localConfig;
@@ -36,7 +36,8 @@ module.exports = function(_configJson, _process) {
3636
getCommitConf: getCommitConf,
3737
getProperty: getProperty,
3838
getLogCommand: getLogCommand,
39-
getCommitPromptText: getCommitPromptText
39+
getCommitPromptText: getCommitPromptText,
40+
getConfigFilesData: getConfigFilesData
4041
};
4142

4243
////////////////
@@ -92,5 +93,45 @@ module.exports = function(_configJson, _process) {
9293
}
9394
return conf.config[prop];
9495
}
96+
97+
function getConfigFilesData() {
98+
var config = [{
99+
name: 'Turbo Commit',
100+
value: 'turbo',
101+
getter: getTurboJson
102+
}, {
103+
name: 'Angular',
104+
value: 'angular',
105+
getter: getAngularJson
106+
}, {
107+
name: 'Open UI5',
108+
value: 'ui5',
109+
getter: getUi5Json
110+
},{
111+
name: 'Custom',
112+
value: 'custom',
113+
getter: getCustomTemplateJson
114+
}];
115+
116+
return config;
117+
118+
//////////
119+
120+
function getTurboJson () {
121+
return require('./configs/turbo.json')
122+
}
123+
124+
function getAngularJson () {
125+
return require('./configs/angular.json')
126+
}
127+
128+
function getUi5Json () {
129+
return require('./configs/open-ui5.json')
130+
}
131+
132+
function getCustomTemplateJson () {
133+
return require('./configs/custom.json')
134+
}
135+
}
95136
}
96137
};

0 commit comments

Comments
 (0)