Comparing version 0.9.70 to 0.9.71
@@ -49,3 +49,3 @@ var fs = require('fs'); | ||
var optionsAccepted = [ 'alice', 'force', 'gulp', 'mocha', 'folder', 'amqp', 'nsq', 'rest', 'websocket' ]; | ||
var optionsAccepted = [ 'alice', 'force', 'gulp', 'mocha', 'folder', 'amqp', 'nsq', 'rest', 'websocket', 'projectFolder' ]; | ||
function readCommand( commands, command ){ | ||
@@ -52,0 +52,0 @@ for( var i =0; i<commands.length; ++i ){ |
@@ -68,7 +68,7 @@ var Fuser = require('../Fuser'); | ||
}, | ||
generateTests: function( config, testFolder ){ | ||
generateTests: function( config, testFolder, options ){ | ||
var self = this; | ||
start( config, function(err, res){ | ||
console.log('Server started with the following components:', res.components); | ||
var fPath = path.join( process.cwd(), testFolder ); | ||
var fPath = path.join( options.projectFolder || process.cwd(), testFolder ); | ||
var closer = function(){ | ||
@@ -75,0 +75,0 @@ res.fuser.stop( function(){ |
@@ -6,6 +6,6 @@ var Collector = require('./Collector'); | ||
createMochaCode: function( options ){ | ||
var config = require( path.join( process.cwd(), 'config' ) ); | ||
var config = require( path.join( options.projectFolder || process.cwd(), 'config' ) ); | ||
return Collector.generateTests( config, options.folder || 'test' ); | ||
return Collector.generateTests( config, options.folder || 'test', options ); | ||
} | ||
}; |
@@ -71,3 +71,3 @@ var fs = require('fs'); | ||
if( options.alice ){ | ||
fse.copySync( path.join(__dirname, 'template', 'alice'), fPath, { clobber: true } ); | ||
fse.copySync( path.join( __dirname, 'template', 'alice'), fPath, { clobber: true } ); | ||
} | ||
@@ -77,4 +77,4 @@ global.done( ); | ||
createEntity: function( name, options ){ | ||
var entityPath = path.join(__dirname, 'template', 'service', 'entity.js'); | ||
var jsPath = path.join( process.cwd(), 'bus', name + '.js'); | ||
var entityPath = path.join( __dirname, 'template', 'service', 'entity.js'); | ||
var jsPath = path.join( options.projectFolder || process.cwd(), 'bus', name + '.js'); | ||
if( fs.existsSync(jsPath) && !options.force ) | ||
@@ -87,3 +87,3 @@ global.forceExit('Such file/folder already exists.'); | ||
//if( options.rest || options.websocket ){ | ||
var configPath = path.join( process.cwd(), 'config.js' ); | ||
var configPath = path.join( options.projectFolder || process.cwd(), 'config.js' ); | ||
try{ | ||
@@ -108,3 +108,3 @@ var config = require( configPath ); | ||
try{ | ||
var entityPath = path.join( process.cwd(), 'bus', entity.endsWith('.js') ? entity : entity+'.js' ); | ||
var entityPath = path.join( options.projectFolder || process.cwd(), 'bus', entity.endsWith('.js') ? entity : entity+'.js' ); | ||
var component = require( entityPath ); | ||
@@ -111,0 +111,0 @@ if( !validateEntity(component) ) |
{ | ||
"name": "floca", | ||
"version": "0.9.70", | ||
"version": "0.9.71", | ||
"description": "Enterprise-grade microservice solution for NodeJS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
111936