code wiki / _hdl_build / nx_mineworld_ship.nx

nx_mineworld_ship.nx source

↩ module page · 28 lines · 1984 B

1// nx_mineworld_ship.nx -- stage the nx_aw_push deploy inputs for MineWorld SOVEREIGNLY (syscall file writes, 2// no bash): src = knowledge/mineworld.html (the packed self-contained playable), dst = atomic cat+mv into the 3// sites.elf docroot as mineworld/index.html so the CLEAN URL https://nishifamily.com/mineworld serves it 4// (the proven gamelab dir/index.html pattern; per-request read = live immediately, purely ADDITIVE = never-brick). 5// Deploy = run nx_aw_push (argless, reads the staged spec) right after this in the SAME nishi-shell session. 6// license_tier: ORIGINAL expect_exit: 0 7import "nx_syscalls.nx" 8 9func mws_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 10 11func main() -> i64 { 12 let sfd: i64 = sys_openat_wr("/mnt/c/Users/elder/AppData/Local/Temp/awpush.src\x00" as *u8, 420) 13 if sfd < 0 { mws_w("nx_mineworld_ship: cannot stage awpush.src\n\x00" as *u8); return 1 } 14 let sp: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/knowledge/mineworld.html\n\x00" as *u8 15 var sn: i64 = 0 16 while sp[sn] != (0 as u8) { sn = sn + 1 } 17 sys_write(sfd, sp, sn) 18 sys_close(sfd) 19 let dfd: i64 = sys_openat_wr("/mnt/c/Users/elder/AppData/Local/Temp/awpush.dst\x00" as *u8, 420) 20 if dfd < 0 { mws_w("nx_mineworld_ship: cannot stage awpush.dst\n\x00" as *u8); return 2 } 21 let dp: *u8 = "mkdir -p /volume1/homes/elderwesto/nishihost/sites/nishifamily/mineworld; cat > /volume1/homes/elderwesto/nishihost/sites/nishifamily/mineworld/index.html.tmp; mv -f /volume1/homes/elderwesto/nishihost/sites/nishifamily/mineworld/index.html.tmp /volume1/homes/elderwesto/nishihost/sites/nishifamily/mineworld/index.html\n\x00" as *u8 22 var dn: i64 = 0 23 while dp[dn] != (0 as u8) { dn = dn + 1 } 24 sys_write(dfd, dp, dn) 25 sys_close(dfd) 26 mws_w("nx_mineworld_ship: staged nx_aw_push inputs (mineworld.html -> sites/nishifamily/mineworld/index.html); deploy = run nx_aw_push\n\x00" as *u8) 27 return 0 28}