source /mnt/profile.js on boot + bugfix cmd fragment
/ mirror_to_github (push) Successful in 17s Details
/ test (push) Successful in 4s Details

This commit is contained in:
Leon van Kammen 2024-08-30 11:09:37 +00:00
parent 3d52b69340
commit 2ba3cc185a
3 changed files with 4 additions and 6 deletions

View File

@ -283,10 +283,10 @@ AFRAME.registerComponent('isoterminal', {
env.push( 'export '+String(i).toUpperCase()+'="'+document.location[i]+'"') env.push( 'export '+String(i).toUpperCase()+'="'+document.location[i]+'"')
} }
env.map( (e) => emulator.serial0_send(`echo '${e}' >> /mnt/profile\n`) ) env.map( (e) => emulator.serial0_send(`echo '${e}' >> /mnt/profile\n`) )
let boot = `source /mnt/profile` let boot = `source /mnt/profile; js "$(cat /mnt/profile.js)"`
// exec hash as extra boot cmd // exec hash as extra boot cmd
if( document.location.hash.length > 1 ){ if( document.location.hash.length > 1 ){
boot += `&& cmd='${decodeURI(document.location.hash.substr(1))}' && $cmd` boot += ` && cmd='${decodeURI(document.location.hash.substr(1))}' && $cmd`
} }
emulator.serial0_send(boot+"\n") emulator.serial0_send(boot+"\n")
instance.winbox.maximize() instance.winbox.maximize()

View File

@ -1,9 +1,6 @@
# source xrsh env # source xrsh env
source /mnt/profile.xrsh source /mnt/profile.xrsh
# source javascript functions
js "$(cat /mnt/profile.js)"
## forward not-found commands to javascript (via jsh) ## forward not-found commands to javascript (via jsh)
command_not_found_handle(){ command_not_found_handle(){
echo "$1 not found, did you mean $1(...) (javascript?)" echo "$1 not found, did you mean $1(...) (javascript?)"
@ -16,7 +13,7 @@ command_not_found_handle(){
} }
resize resize
#clear test $HOSTNAME = localhost || clear
cat /mnt/motd cat /mnt/motd
export PATH=$PATH:/mnt export PATH=$PATH:/mnt
export PS1="\nxrsh # \033[0m" export PS1="\nxrsh # \033[0m"

View File

@ -43,5 +43,6 @@ test -d /dev/browser || {
setup_binaries setup_binaries
setup_browser_dev setup_browser_dev
setup_hook_dirs setup_hook_dirs
} }