Skip to content

Commit

Permalink
fix assemble again
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 24, 2023
1 parent 5357697 commit 9cdfa7b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ public void generate(
final Spec spec = networkOptions.getSpec();
final boolean outputToFile =
genesisParams.outputFile != null && !genesisParams.outputFile.isBlank();
try (final OutputStream fileStream =
outputToFile ? new FileOutputStream(genesisParams.outputFile) : System.out) {
OutputStream fileStream = System.out;
try {
if (outputToFile) {
fileStream = new FileOutputStream(genesisParams.outputFile);
SUB_COMMAND_LOG.generatingMockGenesis(
genesisParams.validatorCount, genesisParams.genesisTime);
}
Expand All @@ -82,6 +83,8 @@ public void generate(
if (outputToFile) {
SUB_COMMAND_LOG.storingGenesis(genesisParams.outputFile, true);
}
} finally {
fileStream.close();
}
}

Expand Down

0 comments on commit 9cdfa7b

Please sign in to comment.