cli/entityfinder.js
function() {
        return new Promise(function(resolve, reject) {
            exec("find . ! -name '" + __filename.split('/').pop() + "' -iname '*\.js' | xargs grep 'CRUD.Entity.call(this);' -isl", {
                timeout: 3000,
                cwd: process.cwd()
            }, function(err, stdout, stdin) {
                var results = stdout.trim().split('\n');
                for (var i = 0; i < results.length; i++) {
                    eval(fs.readFileSync(results[i]) + '');
                }
                resolve(Object.keys(CRUD.entities));
            });
        });
    }
function() {
        return new Promise(function(resolve, reject) {
            exec("find . ! -name '" + __filename.split('/').pop() + "' -iname '*\.js' | xargs grep 'CRUD.Entity.call(this);' -isl", {
                timeout: 3000,
                cwd: process.cwd()
            }, function(err, stdout, stdin) {
                var results = stdout.trim().split('\n');
                for (var i = 0; i < results.length; i++) {
                    eval(fs.readFileSync(results[i]) + '');
                }
                resolve(Object.keys(CRUD.entities));
            });
        });
    }
function ( ) { return new Promise ( function ( resolve , reject ) { exec ( "find . ! -name '" + __filename . split ( '/' ) . pop ( ) + "' -iname '*\.js' | xargs grep 'CRUD.Entity.call(this);' -isl" , { timeout : 3000 , cwd : process . cwd ( ) } , function ( err , stdout , stdin ) { var results = stdout . trim ( ) . split ( '\n' ) ; for ( var i = 0 ; i < results . length ; i ++ ) { eval ( fs . readFileSync ( results [ i ] ) + '' ) ; } resolve ( Object . keys ( CRUD . entities ) ) ; } ) ; } ) ; }
Find and register all CRUD entities under the base dir.
evaluates the files
@return {Promise} array of defined CRUD entities
Find and register all CRUD entities under the base dir . evaluates the files