Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
args,
{cwd : path.join(__dirname,".."), stdio: "inherit"});
cmd.on('exit', function(code){
console.log("Exiting",code);
});
}
else if(argv._[0] === 'prepare') {
// Validate node version
const Utils = require('../api/services/Utils');
if(!Utils.isRuntimeVersionSupported()) {
console.error("Incompatible Node.js version. Please make sure that you have Node.js >= 8 installed.")
process.exit(1);
}
Sails.log("Preparing database...")
if(!process.env.DB_ADAPTER && !argv.adapter) {
Sails.log.error("No db adapter defined. Set --adapter {mongo || mysql || postgres || sql-srv}")
return process.exit(1);
}
if(!process.env.DB_URI && !argv.uri) {
Sails.log.error("No db connection string is defined. Set --uri {db_connection_string}")
return process.exit(1);
}
process.env.DB_ADAPTER = process.env.DB_ADAPTER || argv.adapter;
process.env.DB_URI = process.env.DB_URI || argv.uri;
process.env.PORT = _.isString(argv.port) || _.isNumber(argv.port) ? argv.port : 1339;
require("../makedb")(function(err) {