Update: 更新socket工作模式
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user