Alexandre Bodin da910b0b39 Fix create new project cli option for mongo not handled correctly
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

Fix typos

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

Add tests for env helpers

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

Typo

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-04-29 11:06:44 +02:00

27 lines
610 B
JavaScript

'use strict';
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
module.exports = ({ connection, client }) => {
const { settings, options } = connection;
const tmpl = fs.readFileSync(path.join(__dirname, 'database-templates', `${client}.template`));
const compile = _.template(tmpl);
return compile({
settings: {
...settings,
srv: settings.srv || false,
ssl: settings.ssl || false,
},
options: {
...options,
ssl: options.ssl || false,
authenticationDatabase: options.authenticationDatabase || null,
},
});
};