mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 11:39:39 +00:00 
			
		
		
		
	Update default update URL to https://artifacts.gay.pizza/foundation
This commit is contained in:
		@ -13,17 +13,16 @@ import java.nio.file.Path
 | 
				
			|||||||
object UpdateUtil {
 | 
					object UpdateUtil {
 | 
				
			||||||
  private val client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.NORMAL).build()
 | 
					  private val client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.NORMAL).build()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Add environment variable override. Document it.
 | 
					  // TODO(liv): Add environment variable override. Document it.
 | 
				
			||||||
  private const val basePath =
 | 
					  private const val basePath =
 | 
				
			||||||
    "https://git.mystic.run/minecraft/foundation/-/jobs/artifacts/main/raw"
 | 
					    "https://artifacts.gay.pizza/foundation"
 | 
				
			||||||
  private const val basePathQueryParams = "job=build"
 | 
					 | 
				
			||||||
  private const val manifestPath = "build/manifests/update.json"
 | 
					  private const val manifestPath = "build/manifests/update.json"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fun fetchManifest() = fetchFile(
 | 
					  fun fetchManifest() = fetchFile(
 | 
				
			||||||
    getUrl(manifestPath), MapSerializer(String.serializer(), ModuleManifest.serializer()),
 | 
					    getUrl(manifestPath), MapSerializer(String.serializer(), ModuleManifest.serializer()),
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fun getUrl(path: String) = "$basePath/$path?$basePathQueryParams"
 | 
					  fun getUrl(path: String) = "$basePath/$path"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private inline fun <reified T> fetchFile(url: String, strategy: DeserializationStrategy<T>): T {
 | 
					  private inline fun <reified T> fetchFile(url: String, strategy: DeserializationStrategy<T>): T {
 | 
				
			||||||
    val request = HttpRequest
 | 
					    val request = HttpRequest
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user