Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function executeDB() {
if( argv._.length > 0 )
{
argv.dbname = argv._.shift().toString();
}
else
{
log.info( 'Error: You must enter a database name!' );
return;
}
index.driver( config.getCurrent().settings, function( err, db )
{
if( global.mode === 'create' )
{
db.createDatabase( argv.dbname, { ifNotExists: true }, function()
{
if( err )
{
log.info( 'Error: Failed to create database!' );
}
else
{
log.info( 'Created database "' + argv.dbname + '"' );
}
db.close();
} );