@lando/backdrop
Version:
A Lando plugin that provides a tight integration with Backdrop.
20 lines (17 loc) • 546 B
JavaScript
;
// Modules
const _ = require('lodash');
const path = require('path');
module.exports = (options, types = ['php', 'server', 'vhosts']) => {
const config = {};
_.forEach(types, type => {
if (_.has(options, `config.${type}`)) {
config[type] = options.config[type];
} else if (!_.has(options, `config.${type}`) && _.has(options, `defaultFiles.${type}`)) {
if (_.has(options, 'confDest')) {
config[type] = path.join(options.confDest, options.defaultFiles[type]);
}
}
});
return config;
};