summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/db-zugbildung-to-json30
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,
+ }
+ );
+}