mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-13 18:10:20 -07:00
26 lines
1.1 KiB
Kotlin
26 lines
1.1 KiB
Kotlin
package KondoKit.pluginmanager
|
|
|
|
object GitLabConfig {
|
|
const val GITLAB_PROJECT_ID = "38297322"
|
|
const val GITLAB_PROJECT_PATH = "2009scape/tools/client-plugins"
|
|
const val GITLAB_BRANCH = "master"
|
|
|
|
const val DEBUG = false // Spams pretty hard
|
|
|
|
fun getGitLabApiBaseUrl(): String = "https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID"
|
|
|
|
fun getRepositoryTreeUrl(): String =
|
|
"${getGitLabApiBaseUrl()}/repository/tree?ref=${GITLAB_BRANCH}&per_page=100"
|
|
|
|
fun getRawFileUrl(filePath: String): String =
|
|
"${getGitLabApiBaseUrl()}/repository/files/${filePath.replace("/", "%2F")}/raw?ref=${GITLAB_BRANCH}"
|
|
|
|
fun getArchiveBaseUrl(): String =
|
|
"https://gitlab.com/$GITLAB_PROJECT_PATH/-/archive/$GITLAB_BRANCH/${GITLAB_PROJECT_PATH.replace("/", "-")}-$GITLAB_BRANCH.zip"
|
|
|
|
fun getArchiveUrl(pluginPath: String): String =
|
|
"${getArchiveBaseUrl()}?path=$pluginPath"
|
|
|
|
fun getArchiveUrlWithRefType(pluginPath: String): String =
|
|
"${getArchiveBaseUrl()}?path=$pluginPath&ref_type=heads"
|
|
}
|