From 8b28625ea287bb9c283eb9f05c79e672a91d909e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 22 Jan 2020 14:54:24 +0100 Subject: [PATCH] Add a little script that converts the templates to JSON For reasons! We are thinking about ways to improve the template workflow, and this is useful for doing that. Signed-off-by: Adam Williamson --- tojson.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tojson.pm diff --git a/tojson.pm b/tojson.pm new file mode 100755 index 00000000..fea5f8fb --- /dev/null +++ b/tojson.pm @@ -0,0 +1,15 @@ +#!/bin/perl + +use JSON; + +my $templates = do './templates'; +my $updates = do './templates-updates'; + +my $tempjson = JSON->new->utf8(1)->pretty(1)->encode($templates); +my $updjson = JSON->new->utf8(1)->pretty(1)->encode($updates); + +open(FILE, "> templates.json"); +print FILE $tempjson; + +open (FILE, "> templates-updates.json"); +print FILE $updjson;