Move claritas invocation to separate function, clean versions in Claritas.

This commit is contained in:
Daniel Scalzi
2020-07-15 18:59:56 -04:00
parent ea23912a85
commit 0ac31e5eb7
2 changed files with 32 additions and 27 deletions

Binary file not shown.

View File

@@ -126,16 +126,7 @@ export abstract class ModuleStructure extends BaseModelStructure<Module> {
}
protected async _doModuleRetrieval(moduleCandidates: ModuleCandidate[], options?: {
preProcess?: (candidate: ModuleCandidate) => void
postProcess?: (module: Module) => void
}): Promise<Module[]> {
const accumulator: Module[] = []
if(moduleCandidates.length > 0) {
// Invoke Claritas
protected async invokeClaritas(moduleCandidates: ModuleCandidate[]): Promise<void> {
if(this.getClaritasType() != null) {
const claritasExecutor = new ClaritasWrapper()
@@ -154,6 +145,7 @@ export abstract class ModuleStructure extends BaseModelStructure<Module> {
this.minecraftVersion,
claritasCandidates.map(entry => entry.filePath)
)
if(this.claritasResult == null) {
this.logger.error('Failed to process Claritas result!')
} else {
@@ -162,6 +154,19 @@ export abstract class ModuleStructure extends BaseModelStructure<Module> {
}
}
}
}
protected async _doModuleRetrieval(moduleCandidates: ModuleCandidate[], options?: {
preProcess?: (candidate: ModuleCandidate) => void
postProcess?: (module: Module) => void
}): Promise<Module[]> {
const accumulator: Module[] = []
if(moduleCandidates.length > 0) {
// Invoke Claritas and attach result to class.
await this.invokeClaritas(moduleCandidates)
// Process Modules
for(const candidate of moduleCandidates) {