diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-12 19:22:29 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-12 19:22:29 +0100 |
commit | 87667f39ba001dd4b21b369e9fcb9a2bdda38501 (patch) | |
tree | f5c96e91ffde3ffaa94779e5f9ce33d1cdfdd852 | |
parent | 4f7e4aad9e4dff740764f4c567482723e99c954a (diff) |
generate both compact and complete JSON files
-rwxr-xr-x | bin/db-zugbildung-to-json | 30 |
1 files 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, + } + ); +} |