fix: finally

This commit is contained in:
ikechan8370 2025-04-09 16:31:17 +08:00
parent fd197abb33
commit 1788ee6d7d

View file

@ -68,6 +68,7 @@ export class Update extends plugin {
* @returns
*/
async runUpdate (isForce) {
try {
let command = 'git -C ./plugins/chatgpt-plugin/ pull --no-rebase'
if (isForce) {
command = `git -C ./plugins/chatgpt-plugin/ checkout . && ${command}`
@ -94,10 +95,8 @@ export class Update extends plugin {
if (npmRet.error) {
logger.mark(`${this.e.logFnc} 更新失败chaite 依赖`)
await this.reply(`chaite 依赖更新失败:\n${npmRet.error.toString()}`)
uping = false
return false
}
uping = false
/** 获取插件提交的最新时间 */
let time = await this.getTime('chatgpt-plugin')
@ -121,6 +120,13 @@ export class Update extends plugin {
logger.mark(`${this.e.logFnc} 最后更新时间:${time}`)
return true
} catch (err) {
logger.error(err)
await this.reply(`更新失败:\n${err.toString()}`)
return false
} finally {
uping = false
}
}
/**