exec() now can return output
This commit is contained in:
parent
5afa537069
commit
6f0481830b
1 changed files with 12 additions and 2 deletions
|
|
@ -34,8 +34,18 @@ ISOTerminal.addEventListener = (event,cb) => {
|
|||
ISOTerminal.listener[event].push(cb)
|
||||
}
|
||||
|
||||
ISOTerminal.prototype.exec = function(shellscript){
|
||||
this.send(`printf "\n\r"; ${shellscript}\n`,1)
|
||||
ISOTerminal.prototype.exec = function(opts){
|
||||
const shellscript = opts[0];
|
||||
const cb = opts[1];
|
||||
if( cb ){
|
||||
window.cb = cb
|
||||
this.send(`printf "\n\r"; ${shellscript} &> /mnt/exec; js '
|
||||
document.querySelector("[isoterminal]").emit("read_file", ["exec", window.cb ])
|
||||
';
|
||||
\n`,1)
|
||||
}else{
|
||||
this.send(`printf "\n\r"; ${shellscript} \n`,1)
|
||||
}
|
||||
}
|
||||
|
||||
ISOTerminal.prototype.hook = function(hookname,args){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue