Skip to content

Commit

Permalink
stop build if no elements
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jan 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 70ee9d8 commit add405d
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/builder/index.js
Original file line number Diff line number Diff line change
@@ -167,20 +167,24 @@ class Builder {
}
let qArr = ms.integrate();

// 3. Translation
this.container.loadMany(qArr, false);
if (qArr.length > 0) {
// 3. Translation
this.container.loadMany(qArr, false);

// 4. Binding
this.logger.info('Setting references in elements, total length ' + this.container.length);
this.container.knitMany();
// 4. Binding
this.logger.info('Setting references in elements, total length ' + this.container.length);
this.container.knitMany();

// 5. Circular start_ and ode_
this.logger.info('Checking for circular references in Records.');
this.container.checkCircRecord();
// 5. Circular start_ and ode_
this.logger.info('Checking for circular references in Records.');
this.container.checkCircRecord();

// 6. check circ UnitDef & FunctionDef
this.container.checkCircUnitDef();
this.container.checkCircFunctionDef();
// 6. check circ UnitDef & FunctionDef
this.container.checkCircUnitDef();
this.container.checkCircFunctionDef();
} else {
this.logger.warn('Empty platform. No elements were loaded.');
}

// === STOP if errors ===
if (!this.logger.hasErrors) {

0 comments on commit add405d

Please sign in to comment.