fixed require+ziprun (runs .sh or zip)
This commit is contained in:
parent
6ce07aa483
commit
bb8fd366dd
|
@ -64,12 +64,19 @@ require(){
|
||||||
echo "<a-entity xrf='$1'></a-entity>" >> /root/index.html
|
echo "<a-entity xrf='$1'></a-entity>" >> /root/index.html
|
||||||
;;
|
;;
|
||||||
|
|
||||||
sh)
|
sh|zip)
|
||||||
js '
|
js '
|
||||||
fetch('$1')
|
fetch("'$1'")
|
||||||
.then( (res) => res.text() )
|
.then( (res) => res.arrayBuffer() )
|
||||||
.then( (text) => console.log(text) )
|
.then( async (buf) => {
|
||||||
'
|
// write to filesystem
|
||||||
|
const term = document.querySelector("[isoterminal]").components.isoterminal.term
|
||||||
|
await term.worker.create_file("'$(basename "$1")'", new Uint8Array(buf) )
|
||||||
|
let cmd = String("'$1'").match(/\.zip$/) ? `/root/bin/ziprun /mnt/"'$(basename $1)'"` : "./'$1'"
|
||||||
|
term.exec(cmd)
|
||||||
|
})
|
||||||
|
' > $file
|
||||||
|
echo "[.] wrote $file"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -9,7 +9,7 @@ fi
|
||||||
if [[ "$1" =~ "zip$" ]]; then
|
if [[ "$1" =~ "zip$" ]]; then
|
||||||
echo "[.] detected XRSH zip package in URL"
|
echo "[.] detected XRSH zip package in URL"
|
||||||
echo "[.] fetching $1"
|
echo "[.] fetching $1"
|
||||||
ziprun "$1"
|
require "$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# otherwise execute
|
# otherwise execute
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue