File tree Expand file tree Collapse file tree
src/main/kotlin/io/github/gnuf0rce/mirai/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ public object GitHubReleasePluginUpdater {
111111 ?.let { File (it.path) }
112112 ? : continue
113113 var needUpdate = false
114- val download = PluginManager .pluginsFolder.resolve(plugin.description.id + " .download" )
114+ val download = PluginManager .pluginsFolder.resolve(" ${plugin.description.id} .download" )
115+ val backup = PluginManager .pluginsFolder.resolve(" ${source.name} .bak" )
115116
116117 plugin.launch(CoroutineName (" update from github" )) {
117118 val latest = try {
@@ -173,10 +174,10 @@ public object GitHubReleasePluginUpdater {
173174 plugin.logger.warning(" 从 $id 升级失败" )
174175 download.deleteOnExit()
175176 } else if (needUpdate) {
176- plugin.logger.info(" 旧版插件 ${source.name} 将尝试添加退出时删除,请在下次启动时手动检查" )
177+ plugin.logger.info(" 旧版插件 ${source.name} 将尝试添加退出时删除(备份) ,请在下次启动时手动检查" )
177178 Runtime .getRuntime().addShutdownHook(Thread {
178179 classLoader.close()
179- source.delete( )
180+ source.renameTo(backup )
180181 })
181182 }
182183 }
You can’t perform that action at this time.
0 commit comments