forked from microsoft/devicescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.js
More file actions
18 lines (18 loc) · 719 Bytes
/
runner.js
File metadata and controls
18 lines (18 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function mymain(m) {
m.setupWebsocketTransport("ws://localhost:8081")
.then(() => {
m.jacsSetDeviceId("1989f4eee0ebe206")
m.jacsStart()
fetch("built/prog.jacs")
.then(r => {
if (r.status == 200)
r.arrayBuffer()
.then(v => m.jacsDeploy(new Uint8Array(v)))
else
console.log("you can copy or symlink built/prog.jacs to jacscript-vm/built/prog.jacs to pre-load it here")
})
}, err => {
console.log("failed to connect to devtools; please run 'jacdac devtools' in console")
})
}
Module().then(mymain)