Browse Source

Added Elxr Cli tools

master
--replace-all 5 years ago
parent
commit
437c14b408
1 changed files with 37 additions and 18 deletions
  1. 37
    18
      index.js

+ 37
- 18
index.js View File



// nodeShellExec('echo', ['elxr'], { inherit : true}) //, {stdio: "inherit"} // nodeShellExec('echo', ['elxr'], { inherit : true}) //, {stdio: "inherit"}


var dbForLabel = function(label){
var dbsForLabel = {
devmysql : 'mysql'
, development : 'mssql'
, production : 'mssql'
}
return dbsForLabel[label] || 'mysql'
}

var __runcmd = function(label){ var __runcmd = function(label){


var op = { var op = {
'h' : ()=>{ console.log(cli + ' ' + ver + ' ' + help); return '-h' } 'h' : ()=>{ console.log(cli + ' ' + ver + ' ' + help); return '-h' }
, 'devmysql' : ()=>{
, 'start' : (label)=>{
console.log('Starting Elixir Server.'); console.log('Starting Elixir Server.');
var env = Object.assign({}, process.env); // Shallow clone it. var env = Object.assign({}, process.env); // Shallow clone it.
// console.dir(env) // console.dir(env)
env.NODE_ENV = 'devmysql';
env.DEBUG = 'loopback:connector:mysql'
env.NODE_ENV = label;
env.DEBUG = 'loopback:connector:' + dbForLabel(label)
nodeShellExec('node', ['--inspect=9228', 'sage-rw/server.js'], {
inherit : true,
shell: true, detached: true,
cwd : 'loopback',
env: env,
shell : true
})


nodeShellExec('node', ['sage-rw/server.js'], {
nodeShellExec('node', ['--inspect=9227', 'sage-r/server.js'], {
inherit : true,
shell: true, detached: true, shell: true, detached: true,
cwd : 'loopback', cwd : 'loopback',
env: env, env: env,
shell : true shell : true
}) })
// nodeShellExec('c:/Program Files/nodejs/node.exe', { inherit : true, cwd : '../loopback'});
// nodeShellExec('pwd', {
// inherit : true
// , cwd : '../loopback'
// , env : env
// nodeShellExec('node', ['--inspect=9226', ' bin/www'], {
// inherit : true,
// shell: true, detached: true,
// cwd : 'qms/server',
// env: env,
// shell : true
// }) // })


// nodeShellExec('node', ['sage-rw/server.js'], {
// inherit : true
// , cwd : '../loopback'
// , env : env
// }) //, {stdio: "inherit"}
nodeShellExec('ember', ['s'], {
inherit : true,
shell: true, detached: true,
cwd : 'qms/',
env: env,
shell : true
})
} }
, 'g' : ()=>{ , 'g' : ()=>{
if(processedArgs.h) { if(processedArgs.h) {
// }) // })
} }
} }
return op[label]();
return op[label] ? op[label]() : op['start'](label);
} }


// mysqldump --add-drop-table --no-data -u root -p db_name | grep 'DROP TABLE' ) > drop_all_tables.sql // mysqldump --add-drop-table --no-data -u root -p db_name | grep 'DROP TABLE' ) > drop_all_tables.sql
var mysql = '../xampp/mysql/bin/mysql' var mysql = '../xampp/mysql/bin/mysql'
var mysqldump = '../xampp/mysql/bin/mysqldump' var mysqldump = '../xampp/mysql/bin/mysqldump'


__runcmd(processedArgs.label || processedArgs._[0] || '-h');
__runcmd(processedArgs.label || processedArgs._[0] || 'h');
// nodeShellExec('git', ['status']); // nodeShellExec('git', ['status']);


function nodeShellExec() { function nodeShellExec() {

Loading…
Cancel
Save