fixed require+ziprun (runs .sh or zip)

This commit is contained in:
Leon van Kammen 2025-02-21 15:58:51 +01:00
parent 6ce07aa483
commit bb8fd366dd
3 changed files with 13 additions and 6 deletions
buildroot-v86/board/v86/rootfs_overlay
etc
root/hook.d/URI/fragment
dist

View File

@ -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"
;; ;;
*) *)

View 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

BIN
dist/v86-linux.iso vendored

Binary file not shown.