fix: core template engine and upload params to resolve Syntax error
This commit is contained in:
@@ -17,7 +17,7 @@ MString.tpl = (str, obj) => {
|
||||
return str;
|
||||
}
|
||||
for (let key in obj) {
|
||||
let re = new RegExp(`{*${key}*}`, 'gim');
|
||||
let re = new RegExp(`{${key}}`, 'gm');
|
||||
str = str.replace(re, obj[key]);
|
||||
}
|
||||
return str;
|
||||
|
||||
@@ -14,7 +14,7 @@ export default class ShellMicroPython extends Shell {
|
||||
indexPath: path.resolve(CLIENT_PATH, config.boardDirPath),
|
||||
esptool: `"${PYTHON.path.cli}" "${MICROPYTHON.path.esptool}"`,
|
||||
com: config.port,
|
||||
baudrate: config.baudRates
|
||||
baudrate: config.baudrate || "460800"
|
||||
};
|
||||
// 兼容性处理:移除模板中可能存在的冗余引号
|
||||
let cmdTemplate = config.command || "";
|
||||
@@ -29,7 +29,7 @@ export default class ShellMicroPython extends Shell {
|
||||
indexPath: path.resolve(CLIENT_PATH, config.boardDirPath),
|
||||
ampy: `"${PYTHON.path.cli}" "${MICROPYTHON.path.ampy}"`,
|
||||
com: config.port,
|
||||
reset: config.reset || ""
|
||||
reset: config.reset || "[]"
|
||||
};
|
||||
// 兼容性处理:移除模板中可能存在的冗余引号
|
||||
let cmdTemplate = config.command || "";
|
||||
|
||||
Reference in New Issue
Block a user