fix(socket): 修复 arduino.upload 逻辑,只编译返回文件供前端烧录
This commit is contained in:
@@ -262,8 +262,16 @@ export default class Socket {
|
|||||||
error2 && Debug.error(error2);
|
error2 && Debug.error(error2);
|
||||||
let [error3,] = await to(fsExtra.outputFile(config.path.code, config.code));
|
let [error3,] = await to(fsExtra.outputFile(config.path.code, config.code));
|
||||||
error3 && Debug.error(error3);
|
error3 && Debug.error(error3);
|
||||||
const [error, result] = await to(shell.upload(config));
|
const [error, result] = await to(shell.compile(config));
|
||||||
error && Debug.error(error);
|
if (error) {
|
||||||
|
Debug.error(error);
|
||||||
|
callback([error, result]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (result.code === 0) {
|
||||||
|
const buildPath = config.path.build;
|
||||||
|
result.files = await Boards.getFiles(config.key, buildPath);
|
||||||
|
}
|
||||||
callback([error, result]);
|
callback([error, result]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user