Fix browser download (#706)
This commit is contained in:
parent
d128dad3dc
commit
a99f0212ac
@ -60,7 +60,7 @@ const rbfTemplate = `
|
|||||||
4c45474f580000006d000100000000001c000000000000000e000000821b038405018130813e8053
|
4c45474f580000006d000100000000001c000000000000000e000000821b038405018130813e8053
|
||||||
74617274696e672e2e2e0084006080XX00448581644886488405018130813e80427965210084000a
|
74617274696e672e2e2e0084006080XX00448581644886488405018130813e80427965210084000a
|
||||||
`
|
`
|
||||||
export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
|
export function deployCoreAsync(resp: pxtc.CompileResult) {
|
||||||
let w: pxt.editor.Ev3Wrapper
|
let w: pxt.editor.Ev3Wrapper
|
||||||
|
|
||||||
let filename = resp.downloadFileBaseName || "pxt"
|
let filename = resp.downloadFileBaseName || "pxt"
|
||||||
@ -101,7 +101,7 @@ export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
|
|||||||
if (pxt.commands && pxt.commands.electronDeployAsync) {
|
if (pxt.commands && pxt.commands.electronDeployAsync) {
|
||||||
return pxt.commands.electronDeployAsync(resp);
|
return pxt.commands.electronDeployAsync(resp);
|
||||||
}
|
}
|
||||||
if (!isCli && pxt.commands && pxt.commands.saveOnlyAsync) {
|
if (pxt.commands && pxt.commands.saveOnlyAsync) {
|
||||||
return pxt.commands.saveOnlyAsync(resp);
|
return pxt.commands.saveOnlyAsync(resp);
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
@ -121,10 +121,7 @@ export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
|
|||||||
.then(() => w.flashAsync(rbfPath, rbfBIN))
|
.then(() => w.flashAsync(rbfPath, rbfBIN))
|
||||||
.then(() => w.runAsync(rbfPath))
|
.then(() => w.runAsync(rbfPath))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (isCli)
|
return w.disconnectAsync()
|
||||||
return w.disconnectAsync()
|
|
||||||
else
|
|
||||||
return Promise.resolve()
|
|
||||||
//return Promise.delay(1000).then(() => w.dmesgAsync())
|
//return Promise.delay(1000).then(() => w.dmesgAsync())
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
// if we failed to initalize, retry
|
// if we failed to initalize, retry
|
||||||
|
Loading…
Reference in New Issue
Block a user