From 87667f39ba001dd4b21b369e9fcb9a2bdda38501 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 12 Jan 2021 19:22:29 +0100 Subject: generate both compact and complete JSON files --- bin/db-zugbildung-to-json | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bin/db-zugbildung-to-json b/bin/db-zugbildung-to-json index fc01f34..a19ecbd 100755 --- a/bin/db-zugbildung-to-json +++ b/bin/db-zugbildung-to-json @@ -790,12 +790,24 @@ for my $train_no ( keys %map ) { } # use canonical output (i.e., sort hash keys) to allow for easy diffing. -say JSON->new->utf8->canonical->encode( - { - deprecated => \0, - source => $wr_name, - train => {%smap}, - train_variants => {%map}, - valid => $valid, - } -); +if ( $ENV{WITH_VARIANTS} ) { + say JSON->new->utf8->canonical->encode( + { + deprecated => \0, + source => $wr_name, + train => {%smap}, + train_variants => {%map}, + valid => $valid, + } + ); +} +else { + say JSON->new->utf8->canonical->encode( + { + deprecated => \0, + source => $wr_name, + train => {%smap}, + valid => $valid, + } + ); +} -- cgit v1.2.3