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:
Daniel Scalzi
2021-03-20 16:28:12 -04:00
parent 2540ca383e
commit 3f90a22972
9 changed files with 126 additions and 53 deletions

View File

@@ -18,7 +18,9 @@ export class ServerStructure extends BaseModelStructure<Server> {
constructor(
absoluteRoot: string,
baseUrl: string
baseUrl: string,
private discardOutput: boolean,
private invalidateCache: boolean
) {
super(absoluteRoot, '', 'servers', baseUrl)
}
@@ -133,7 +135,9 @@ export class ServerStructure extends BaseModelStructure<Server> {
serverMeta.forge.version,
dirname(this.containerDirectory),
'',
this.baseUrl
this.baseUrl,
this.discardOutput,
this.invalidateCache
)
// Resolve forge