Add output caching for Forge 1.13+.
CHANGES - Forge installer is no longer stored to the work directory. It is now stored in a cache folder corresponding to the artifact version. - Installer output is now cached by default - Added options to generate distro. - --discardOutput Delete cached output after it is no longer required. May be useful if disk space is limited. - --invalidateCache Invalidate and delete existing caches as they are encountered. Requires fresh cache generation. - Both options are false by default. - To invalide a single version, manually delete the folder. - Old functionality is essentially g distro --discardOutput --invalidateCache.
This commit is contained in:
@@ -24,11 +24,13 @@ export class VersionSegmentedRegistry {
|
||||
forgeVersion: string,
|
||||
absoluteRoot: string,
|
||||
relativeRoot: string,
|
||||
baseURL: string
|
||||
baseURL: string,
|
||||
discardOutput: boolean,
|
||||
invalidateCache: boolean
|
||||
): ForgeResolver {
|
||||
for (const impl of VersionSegmentedRegistry.FORGE_ADAPTER_IMPL) {
|
||||
if (impl.isForVersion(minecraftVersion, forgeVersion)) {
|
||||
return new impl(absoluteRoot, relativeRoot, baseURL, minecraftVersion, forgeVersion)
|
||||
return new impl(absoluteRoot, relativeRoot, baseURL, minecraftVersion, forgeVersion, discardOutput, invalidateCache)
|
||||
}
|
||||
}
|
||||
throw new Error(`No forge resolver found for Minecraft ${minecraftVersion}!`)
|
||||
|
||||
Reference in New Issue
Block a user