Summary
In src/commands/validate/index.ts, two separate methods validate the exact same condition - whether fabricVersion >= 2.0.0:
_validateFabricVersion() (line 153) - emits a CRITICAL error -> calls process.exit(1) immediately
-
_verifyFabricVersion() (line 562) - emits a regular ERROR -> just adds to error list
Since _validateFabricVersion is called first (line 118 in validate()) and exits the process on failure, _verifyFabricVersion (called at line 150) is unreachable dead code when the version check fails.
Steps to Reproduce
- Set
fabricVersion to "1.4.0" in a fablo-config.json
-
- Run
fablo validate
-
- Observe that
_validateFabricVersion fires first and exits with process.exit(1)
-
_verifyFabricVersion never executes
Expected Behavior
There should be a single, clear Fabric version validation - not two methods checking the same thing with different severity levels.
Proposed Fix
Remove the redundant _verifyFabricVersion method (lines 562-567) and its call (line 150). The existing _validateFabricVersion already handles this correctly with a CRITICAL exit.
Happy to open a PR for this fix.
Summary
In
src/commands/validate/index.ts, two separate methods validate the exact same condition - whetherfabricVersion >= 2.0.0:_validateFabricVersion()(line 153) - emits aCRITICALerror -> callsprocess.exit(1)immediately_verifyFabricVersion()(line 562) - emits a regularERROR-> just adds to error listSince
_validateFabricVersionis called first (line 118 invalidate()) and exits the process on failure,_verifyFabricVersion(called at line 150) is unreachable dead code when the version check fails.Steps to Reproduce
fabricVersionto"1.4.0"in afablo-config.jsonfablo validate_validateFabricVersionfires first and exits withprocess.exit(1)_verifyFabricVersionnever executesExpected Behavior
There should be a single, clear Fabric version validation - not two methods checking the same thing with different severity levels.
Proposed Fix
Remove the redundant
_verifyFabricVersionmethod (lines 562-567) and its call (line 150). The existing_validateFabricVersionalready handles this correctly with a CRITICAL exit.Happy to open a PR for this fix.