bugfix: fixes #3096

This commit is contained in:
vmarchaud 2017-08-21 14:00:39 +02:00
parent 11dddfc843
commit cc0f0aa809
2 changed files with 10 additions and 5 deletions

View File

@ -169,15 +169,15 @@ function installModule(CLI, module_name, opts, cb) {
Common.printError(e);
}
Common.extend(opts, {
opts = Common.extend(opts, {
cmd : cmd,
development_mode : development_mode,
proc_path : proc_path
});
Configuration.set(MODULE_CONF_PREFIX + ':' + canonic_module_name, {
uid : opts.uid || null,
gid : opts.gid || null
uid : opts.uid,
gid : opts.gid
}, function(err, data) {
startModule(CLI, opts, function(err, dt) {

View File

@ -445,8 +445,13 @@ Common.printOut = function() {
/**
* Raw extend
*/
Common.extend = function(destination, source){
if (!source || typeof source != 'object') return destination;
Common.extend = function(destination, source) {
if (typeof destination !== 'object') {
destination = {};
}
if (!source || typeof source !== 'object') {
return destination;
}
Object.keys(source).forEach(function(new_key) {
if (source[new_key] != '[object Object]')