fix: 使用自定义 OTA 信息

This commit is contained in:
Del Wang
2025-04-13 11:56:53 +08:00
parent 11afe07385
commit 3ef2587732
3 changed files with 19 additions and 8 deletions
+7 -2
View File
@@ -82,8 +82,13 @@ async function getOTA(channel: "release" | "current" | "stable" = "release") {
async function main() {
console.log(`🔥 正在获取设备信息...`);
const ota = await getOTA();
if (!ota) {
let ota: any = {};
if (process.env.OTA) {
ota = JSON.parse(process.env.OTA);
} else {
ota = await getOTA();
}
if (!ota.url) {
console.log(`❌ 获取设备信息失败`);
process.exit(1);
}