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

This commit is contained in:
Daniel Scalzi committed 2020-07-16 20:26:22 -04:00
1 parent ea23912a85
commit 0ac31e5eb7
2 files changed
+15 -10

No files matched your search

Binary file not shown.
+15 -10
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) {