mirror of
https://fastgit.cc/github.com/hicccc77/WeFlow
synced 2026-04-20 12:51:02 +08:00
2
.github/workflows/dev-daily-fixed.yml
vendored
2
.github/workflows/dev-daily-fixed.yml
vendored
@@ -107,7 +107,7 @@ jobs:
|
||||
run: |
|
||||
export ELECTRON_BUILDER_BINARIES_MIRROR="https://github.com/electron-userland/electron-builder-binaries/releases/download/"
|
||||
echo "Using ELECTRON_BUILDER_BINARIES_MIRROR=$ELECTRON_BUILDER_BINARIES_MIRROR"
|
||||
npx electron-builder --mac dmg --arm64 --publish never '--config.publish.channel=dev' '--config.artifactName=${productName}-dev-arm64.${ext}'
|
||||
npx electron-builder --mac dmg zip --arm64 --publish never '--config.publish.channel=dev' '--config.artifactName=${productName}-dev-arm64.${ext}'
|
||||
|
||||
- name: Upload macOS arm64 assets to fixed release
|
||||
env:
|
||||
|
||||
2
.github/workflows/preview-nightly-main.yml
vendored
2
.github/workflows/preview-nightly-main.yml
vendored
@@ -136,7 +136,7 @@ jobs:
|
||||
run: |
|
||||
export ELECTRON_BUILDER_BINARIES_MIRROR="https://github.com/electron-userland/electron-builder-binaries/releases/download/"
|
||||
echo "Using ELECTRON_BUILDER_BINARIES_MIRROR=$ELECTRON_BUILDER_BINARIES_MIRROR"
|
||||
npx electron-builder --mac dmg --arm64 --publish never '--config.publish.channel=preview' '--config.artifactName=${productName}-preview-arm64.${ext}'
|
||||
npx electron-builder --mac dmg zip --arm64 --publish never '--config.publish.channel=preview' '--config.artifactName=${productName}-preview-arm64.${ext}'
|
||||
|
||||
- name: Upload macOS arm64 assets to fixed preview release
|
||||
env:
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
npx tsc
|
||||
npx vite build
|
||||
|
||||
- name: Package and Publish macOS arm64 (unsigned DMG)
|
||||
- name: Package and Publish macOS arm64 (unsigned DMG + ZIP)
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: |
|
||||
export ELECTRON_BUILDER_BINARIES_MIRROR="https://github.com/electron-userland/electron-builder-binaries/releases/download/"
|
||||
echo "Using ELECTRON_BUILDER_BINARIES_MIRROR=$ELECTRON_BUILDER_BINARIES_MIRROR"
|
||||
npx electron-builder --mac dmg --arm64 --publish always
|
||||
npx electron-builder --mac dmg zip --arm64 --publish always
|
||||
|
||||
- name: Inject minimumVersion into latest yml
|
||||
env:
|
||||
|
||||
@@ -1891,9 +1891,17 @@ function registerIpcHandlers() {
|
||||
downloadedHandler = null
|
||||
}
|
||||
|
||||
// 统一错误提示格式,避免出现 [object Object] 的 JSON 字符串
|
||||
const errorMessage = error.message || (typeof error === 'string' ? error : JSON.stringify(error))
|
||||
throw new Error(errorMessage)
|
||||
const errorCode = typeof error?.code === 'string' ? error.code : ''
|
||||
const rawErrorMessage =
|
||||
typeof error?.message === 'string'
|
||||
? error.message
|
||||
: (typeof error === 'string' ? error : JSON.stringify(error))
|
||||
|
||||
if (errorCode === 'ERR_UPDATER_ZIP_FILE_NOT_FOUND' || /ZIP file not provided/i.test(rawErrorMessage)) {
|
||||
throw new Error('当前发布版本缺少 macOS 自动更新所需的 ZIP 包,请联系开发者重新发布该版本')
|
||||
}
|
||||
|
||||
throw new Error(rawErrorMessage || '下载更新失败,请稍后重试')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -652,6 +652,12 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
||||
void refreshWhisperStatus(whisperModelDir)
|
||||
}, [whisperModelDir])
|
||||
|
||||
const getErrorMessage = (error: any): string => {
|
||||
const raw = typeof error?.message === 'string' ? error.message : String(error ?? '')
|
||||
const normalized = raw.replace(/^Error:\s*/i, '').trim()
|
||||
return normalized || '未知错误'
|
||||
}
|
||||
|
||||
const handleCheckUpdate = async () => {
|
||||
if (isCheckingUpdate) return
|
||||
setIsCheckingUpdate(true)
|
||||
@@ -666,7 +672,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
||||
showMessage('当前已是最新版', true)
|
||||
}
|
||||
} catch (e: any) {
|
||||
showMessage(`检查更新失败: ${e}`, false)
|
||||
showMessage(`检查更新失败: ${getErrorMessage(e)}`, false)
|
||||
} finally {
|
||||
setIsCheckingUpdate(false)
|
||||
}
|
||||
@@ -681,7 +687,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
||||
showMessage('正在下载更新...', true)
|
||||
await window.electronAPI.app.downloadAndInstall()
|
||||
} catch (e: any) {
|
||||
showMessage(`更新失败: ${e}`, false)
|
||||
showMessage(`更新失败: ${getErrorMessage(e)}`, false)
|
||||
setIsDownloading(false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user