Move claritas invocation to separate function, clean versions in Claritas.
This commit is contained in:
Binary file not shown.
@@ -126,16 +126,7 @@ export abstract class ModuleStructure extends BaseModelStructure<Module> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async _doModuleRetrieval(moduleCandidates: ModuleCandidate[], options?: {
|
protected async invokeClaritas(moduleCandidates: ModuleCandidate[]): Promise<void> {
|
||||||
preProcess?: (candidate: ModuleCandidate) => void
|
|
||||||
postProcess?: (module: Module) => void
|
|
||||||
}): Promise<Module[]> {
|
|
||||||
|
|
||||||
const accumulator: Module[] = []
|
|
||||||
|
|
||||||
if(moduleCandidates.length > 0) {
|
|
||||||
|
|
||||||
// Invoke Claritas
|
|
||||||
if(this.getClaritasType() != null) {
|
if(this.getClaritasType() != null) {
|
||||||
const claritasExecutor = new ClaritasWrapper()
|
const claritasExecutor = new ClaritasWrapper()
|
||||||
|
|
||||||
@@ -154,6 +145,7 @@ export abstract class ModuleStructure extends BaseModelStructure<Module> {
|
|||||||
this.minecraftVersion,
|
this.minecraftVersion,
|
||||||
claritasCandidates.map(entry => entry.filePath)
|
claritasCandidates.map(entry => entry.filePath)
|
||||||
)
|
)
|
||||||
|
|
||||||
if(this.claritasResult == null) {
|
if(this.claritasResult == null) {
|
||||||
this.logger.error('Failed to process Claritas result!')
|
this.logger.error('Failed to process Claritas result!')
|
||||||
} else {
|
} 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
|
// Process Modules
|
||||||
for(const candidate of moduleCandidates) {
|
for(const candidate of moduleCandidates) {
|
||||||
|
|||||||
Reference in New Issue
Block a user