Compare commits

...

7 Commits

Author SHA1 Message Date
b45bf7512c 0.0.9 2017-08-07 11:13:05 +02:00
2dec405a9b Catch errors from initAsync 2017-08-07 11:12:52 +02:00
29009aa5e5 0.0.8 2017-08-07 11:08:15 +02:00
86011827dc Fix initialization without HID 2017-08-07 10:56:21 +02:00
c20cfab069 Fix web deployment, only use HF2 when in localhost (#2) 2017-08-05 17:54:18 +01:00
197f9096f8 0.0.7 2017-08-04 22:53:11 -07:00
6d499cb683 Fix package.json 2017-08-04 22:52:53 -07:00
2 changed files with 11 additions and 10 deletions

View File

@ -28,13 +28,18 @@ namespace pxt.editor {
let initPromise: Promise<Ev3Wrapper> let initPromise: Promise<Ev3Wrapper>
function initAsync() { function initAsync() {
if (!initPromise) const forceHexDownload = /forceHexDownload/i.test(window.location.href);
if (!initPromise && Cloud.isLocalHost() && Cloud.localToken && !forceHexDownload)
initPromise = hf2Async() initPromise = hf2Async()
.catch(err => { .catch(err => {
initPromise = null initPromise = null
noHID = true noHID = true
return Promise.reject(err) return Promise.reject(err)
}) })
else {
noHID = true
initPromise = Promise.reject(new Error("no HID"))
}
return initPromise return initPromise
} }
@ -116,13 +121,9 @@ namespace pxt.editor {
const res: pxt.editor.ExtensionResult = { const res: pxt.editor.ExtensionResult = {
deployCoreAsync, deployCoreAsync,
}; };
initAsync() initAsync().catch(e => {
/* // probably no HID - we'll try this again upon deployment
.then(w => w.streamFileAsync("/tmp/serial.txt", buf => { })
let str = Util.fromUTF8(Util.uint8ArrayToString(buf))
}))
*/
return Promise.resolve<pxt.editor.ExtensionResult>(res); return Promise.resolve<pxt.editor.ExtensionResult>(res);
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-ev3", "name": "pxt-ev3",
"version": "0.0.6", "version": "0.0.9",
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode", "description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
"private": true, "private": true,
"keywords": [ "keywords": [
@ -40,7 +40,7 @@
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "0.9.2", "pxt-common-packages": "0.9.2",
"pxt-core": "^2.0.2" "pxt-core": "2.0.2"
}, },
"scripts": { "scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis" "test": "node node_modules/pxt-core/built/pxt.js travis"