Преглед на файлове

elxr use enhancements

production
Pradeep Bhaskaran преди 4 години
родител
ревизия
ff898d027a
променени са 1 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. 13
    8
      index.js

+ 13
- 8
index.js Целия файл

, 'elxr' , 'elxr'
, 'ember-searchable-select' , 'ember-searchable-select'
, 'loopback-component-jsonapi' , 'loopback-component-jsonapi'
, 'elixir-config'
, 'elixir-config-development'
, 'cihsr-config' , 'cihsr-config'
, 'cihsr-data' , 'cihsr-data'
, 'elixir-data' , 'elixir-data'
}) })
} }
, 'runas' : ()=>{ , 'runas' : ()=>{
return isRunningElevated().then(
() => op[ processedArgs.label || processedArgs._[0] || 'h']()
)
return isRunningElevated().then(() => op[ processedArgs.label || processedArgs._[0] || 'h']() )
.catch(()=>{ .catch(()=>{
console.log('Not Elevated'); console.log('Not Elevated');
console.dir(processedArgs) console.dir(processedArgs)
console.log('Requesting Elevated Privileges for : ' + `--insptec-brk elxr ${processedArgs._[0]} ${processedArgs._[1]} --runas=true`)
nodeShellExec('MSHTA', [`javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('node', 'elxr ${processedArgs._[0]} ${processedArgs._[1]} --runas=true', '', 'runas', 1);close();`]
// PB : TODO -- Convert all the cli args back to string.
var namedArgs = [];
Object.keys(processedArgs).forEach((v)=>{ v!='_' ? namedArgs.push('--'+v+'='+processedArgs[v]) : null; })
var cargs = `${processedArgs.debug ? '--inspect-brk' : ''} --inspect-brk elxr ${processedArgs._.join(' ')} ${namedArgs.join(' ') } --runas=true`
console.log('Requesting Elevated Privileges for : ' + `node ${cargs}`)
// fs.writeFileSync('runas.js', `javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('node', '${cargs}', '', 'runas', 1);close();`)
nodeShellExec('MSHTA', [`javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('node', '${cargs}', '', 'runas', 1);close();`]
, { , {
// inherit : true // inherit : true
// , shell: true // , shell: true
// cwd : process.env.pwd
// ,
env: process.env env: process.env
, title : `runas`
} }
); );
}) })
if(processedArgs._[1] && runconfig.use !== processedArgs._[1]) runconfig.use = processedArgs._[1]; if(processedArgs._[1] && runconfig.use !== processedArgs._[1]) runconfig.use = processedArgs._[1];
if(!runconfig.use) { throw 'unspecifed use not allowed. Please specify chess instance name.' } if(!runconfig.use) { throw 'unspecifed use not allowed. Please specify chess instance name.' }


fs.writeFileSync('../run.js', 'module.exports = ' + JSON.stringify(runconfig))
// console.log(process.env.cwd)
fs.writeFileSync('./run.js', 'module.exports = ' + JSON.stringify(runconfig))
tasks = [ tasks = [
()=>{ ()=>{

Loading…
Отказ
Запис