fix: make shell command robust against cached double quotes from frontend
This commit is contained in:
@@ -15,7 +15,10 @@ export default class ShellMicroPython extends Shell {
|
|||||||
esptool: `"${PYTHON.path.cli}" "${MICROPYTHON.path.esptool}"`,
|
esptool: `"${PYTHON.path.cli}" "${MICROPYTHON.path.esptool}"`,
|
||||||
com: config.port
|
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);
|
console.log('DEBUG CMD BURN:', command);
|
||||||
return this.execUntilClosed(command);
|
return this.execUntilClosed(command);
|
||||||
}
|
}
|
||||||
@@ -26,7 +29,10 @@ export default class ShellMicroPython extends Shell {
|
|||||||
ampy: `"${PYTHON.path.cli}" "${MICROPYTHON.path.ampy}"`,
|
ampy: `"${PYTHON.path.cli}" "${MICROPYTHON.path.ampy}"`,
|
||||||
com: config.port
|
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);
|
console.log('DEBUG CMD UPLOAD:', command);
|
||||||
return this.execUntilClosed(command);
|
return this.execUntilClosed(command);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user