Reject promise when deploy to board fails (#267)
* Reject promise when deploy to board fails * Change var to let
This commit is contained in:
parent
a34f765681
commit
5e9eec61c5
@ -13,10 +13,13 @@ export function deployCoreAsync(res: ts.pxtc.CompileResult) {
|
||||
return getBitDrivesAsync()
|
||||
.then(drives => {
|
||||
if (drives.length == 0) {
|
||||
console.log("cannot find any drives to deploy to")
|
||||
} else {
|
||||
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "))
|
||||
let msg = "cannot find any drives to deploy to";
|
||||
console.log(msg);
|
||||
return Promise.reject(new Error(msg));
|
||||
}
|
||||
|
||||
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "))
|
||||
|
||||
return Promise.map(drives, d =>
|
||||
writeFileAsync(d + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX])
|
||||
.then(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user