diff --git a/src/common/shell-micropython.js b/src/common/shell-micropython.js index 87af8579..214ef0c5 100755 --- a/src/common/shell-micropython.js +++ b/src/common/shell-micropython.js @@ -15,7 +15,10 @@ export default class ShellMicroPython extends Shell { esptool: `"${PYTHON.path.cli}" "${MICROPYTHON.path.esptool}"`, com: config.port }; - const command = MString.tpl(config.command, info); + // 兼容性处理:移除模板中可能存在的冗余引号 + let cmdTemplate = config.command || ""; + cmdTemplate = cmdTemplate.replace(/"{esptool}"/g, '{esptool}'); + const command = MString.tpl(cmdTemplate, info); console.log('DEBUG CMD BURN:', command); return this.execUntilClosed(command); } @@ -26,7 +29,10 @@ export default class ShellMicroPython extends Shell { ampy: `"${PYTHON.path.cli}" "${MICROPYTHON.path.ampy}"`, com: config.port }; - const command = MString.tpl(config.command, info); + // 兼容性处理:移除模板中可能存在的冗余引号 + let cmdTemplate = config.command || ""; + cmdTemplate = cmdTemplate.replace(/"{ampy}"/g, '{ampy}'); + const command = MString.tpl(cmdTemplate, info); console.log('DEBUG CMD UPLOAD:', command); return this.execUntilClosed(command); }