[deploy] refactoring
This commit is contained in:
parent
b28919275f
commit
fa5c7bbb30
|
@ -102,20 +102,12 @@ module.exports = function(grunt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doRegisterInitializeAppTask(name, appName, configFile) {
|
function doRegisterInitializeAppTask(name, appName, configFile) {
|
||||||
if ( !!process.env['EXTRA_CONFIG_PATH'] &&
|
if (!!process.env['BRANDING_PATH'] &&
|
||||||
grunt.file.exists(process.env['EXTRA_CONFIG_PATH'] + '/' + configFile) )
|
grunt.file.exists(process.env['BRANDING_PATH'] + '/' + configFile))
|
||||||
{
|
{
|
||||||
var _extConfig = require(process.env['EXTRA_CONFIG_PATH'] + '/' + configFile);
|
var _extConfig = require(process.env['BRANDING_PATH'] + '/' + configFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return grunt.registerTask('init-build-' + name, 'Initialize build ' + appName, function(){
|
|
||||||
defaultConfig = configFile;
|
|
||||||
packageFile = require('./' + defaultConfig);
|
|
||||||
|
|
||||||
if (packageFile) {
|
|
||||||
grunt.log.ok(appName + ' config loaded successfully'.green);
|
|
||||||
|
|
||||||
if ( !!_extConfig && _extConfig.name == packageFile.name ) {
|
|
||||||
function _merge(target, ...sources) {
|
function _merge(target, ...sources) {
|
||||||
if (!sources.length) return target;
|
if (!sources.length) return target;
|
||||||
const source = sources.shift();
|
const source = sources.shift();
|
||||||
|
@ -135,6 +127,14 @@ module.exports = function(grunt) {
|
||||||
return _merge(target, ...sources);
|
return _merge(target, ...sources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return grunt.registerTask('init-build-' + name, 'Initialize build ' + appName, function(){
|
||||||
|
defaultConfig = configFile;
|
||||||
|
packageFile = require('./' + defaultConfig);
|
||||||
|
|
||||||
|
if (packageFile) {
|
||||||
|
grunt.log.ok(appName + ' config loaded successfully'.green);
|
||||||
|
|
||||||
|
if ( !!_extConfig && _extConfig.name == packageFile.name ) {
|
||||||
_merge(packageFile, _extConfig);
|
_merge(packageFile, _extConfig);
|
||||||
}
|
}
|
||||||
} else grunt.log.error().writeln('Could not load config file'.red);
|
} else grunt.log.error().writeln('Could not load config file'.red);
|
||||||
|
|
Loading…
Reference in a new issue