Update: 更新socket工作模式

This commit is contained in:
王立帮
2024-12-02 21:18:18 +08:00
parent d245eaf458
commit 5ea6082fbe
7 changed files with 163 additions and 53 deletions

View File

@@ -0,0 +1,31 @@
import path from 'node:path';
import Shell from './shell';
import MString from './mstring';
import { MICROPYTHON, PYTHON, CLIENT_PATH } from './config';
export default class ShellMicroPython extends Shell {
constructor() {
super();
}
async burn(config) {
const info = {
indexPath: path.resolve(CLIENT_PATH, config.boardDirPath),
esptool: `${PYTHON.path.cli}" "${MICROPYTHON.path.esptool}`,
com: config.port
};
const command = MString.tpl(config.command, info);
return this.exec(command);
}
async upload(config) {
const info = {
indexPath: path.resolve(CLIENT_PATH, config.boardDirPath),
ampy: `${PYTHON.path.cli}" "${MICROPYTHON.path.ampy}`,
com: config.port
};
const command = MString.tpl(config.command, info);
return this.exec(command);
}
}