bugfix: properly escape exec command-strings
This commit is contained in:
parent
9d549454d6
commit
c79af592e6
1 changed files with 3 additions and 6 deletions
|
|
@ -37,15 +37,12 @@ ISOTerminal.addEventListener = (event,cb) => {
|
||||||
ISOTerminal.prototype.exec = function(opts){
|
ISOTerminal.prototype.exec = function(opts){
|
||||||
const shellscript = opts[0];
|
const shellscript = opts[0];
|
||||||
const cb = opts[1];
|
const cb = opts[1];
|
||||||
|
let cmd = `printf "\n\r"; { sh<<EOF\n ${shellscript}; \nEOF\n} &> /mnt/exec;\n`
|
||||||
if( cb ){
|
if( cb ){
|
||||||
window.cb = cb
|
window.cb = cb
|
||||||
this.send(`printf "\n\r"; ${shellscript} &> /mnt/exec; js '
|
cmd += `js 'document.querySelector("[isoterminal]").emit("read_file", ["exec", window.cb ])';\n`
|
||||||
document.querySelector("[isoterminal]").emit("read_file", ["exec", window.cb ])
|
|
||||||
';
|
|
||||||
\n`,1)
|
|
||||||
}else{
|
|
||||||
this.send(`printf "\n\r"; ${shellscript} \n`,1)
|
|
||||||
}
|
}
|
||||||
|
this.send( cmd, 1 )
|
||||||
}
|
}
|
||||||
|
|
||||||
ISOTerminal.prototype.hook = function(hookname,args){
|
ISOTerminal.prototype.hook = function(hookname,args){
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue