mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
fix: 修正方法参数使用错误的问题.
MavenRepositoryConfig 的 toRemoteRepository 方法使用了参数默认值, 可能会导致意外使用常量的情况, 故移除 MavenRepositoryConfig.toRemoteRepository 的参数默认值. Pull Request #6
This commit is contained in:
parent
d24572a4f3
commit
ce613787f6
@ -106,7 +106,7 @@ internal data class MavenRepositoryConfig(
|
|||||||
val authentication: Authentication? = null
|
val authentication: Authentication? = null
|
||||||
) {
|
) {
|
||||||
|
|
||||||
fun toRemoteRepository(proxyConfig: ProxyConfig = Const.config.proxy): RemoteRepository {
|
fun toRemoteRepository(proxyConfig: ProxyConfig): RemoteRepository {
|
||||||
val builder = RemoteRepository.Builder(null, checkRepositoryLayout(layout), url.toString())
|
val builder = RemoteRepository.Builder(null, checkRepositoryLayout(layout), url.toString())
|
||||||
if (proxy != null) {
|
if (proxy != null) {
|
||||||
builder.setProxy(proxy)
|
builder.setProxy(proxy)
|
||||||
|
@ -123,7 +123,7 @@ internal class Launcher(private val config: AppConfig = Const.config) : AutoClos
|
|||||||
val account = botConfig.account
|
val account = botConfig.account
|
||||||
|
|
||||||
val remoteRepositories = config.mavenRepositories
|
val remoteRepositories = config.mavenRepositories
|
||||||
.map(MavenRepositoryConfig::toRemoteRepository)
|
.map { it.toRemoteRepository(config.proxy) }
|
||||||
.toMutableList().apply {
|
.toMutableList().apply {
|
||||||
if (this.none {
|
if (this.none {
|
||||||
it.url == MavenRepositoryExtensionFinder.MAVEN_CENTRAL_URL
|
it.url == MavenRepositoryExtensionFinder.MAVEN_CENTRAL_URL
|
||||||
|
Loading…
Reference in New Issue
Block a user