gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: implement TypeScript data gener


From: gnunet
Subject: [taler-anastasis] branch master updated: implement TypeScript data generation
Date: Tue, 05 Oct 2021 10:42:36 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new be5e8be  implement TypeScript data generation
be5e8be is described below

commit be5e8be888f4e2ab033c12bbb37b1eec2478aa37
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Oct 5 10:42:30 2021 +0200

    implement TypeScript data generation
---
 contrib/.gitignore |  1 +
 contrib/gen-ts.sh  | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/contrib/.gitignore b/contrib/.gitignore
new file mode 100644
index 0000000..93559bd
--- /dev/null
+++ b/contrib/.gitignore
@@ -0,0 +1 @@
+anastasis-data.ts
diff --git a/contrib/gen-ts.sh b/contrib/gen-ts.sh
new file mode 100755
index 0000000..bc204d1
--- /dev/null
+++ b/contrib/gen-ts.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Generate a single TS file from the JSON data files in contrib/.
+# Requires prettier to be installed.
+
+gen_ts() {
+  echo "// This file is auto-generated, do not modify."
+  echo "// Generated from $(git describe --tags) on $(date -R)"
+  echo "// To re-generate, run contrib/gen-ts.sh from the main anastasis code 
base."
+  echo
+  echo "export const anastasisData = {"
+  echo "providersList: $(cat provider-list.json),"
+  echo "countriesList: $(cat redux.countries.json),"
+  echo "countryDetails: {"
+  for f in redux.??.json; do
+    cc=$(echo $f | awk -F "." '{ print $2 }')
+    echo "$cc: $(cat $f),"
+  done
+  echo "}," # country details
+  echo "}" # anastasis data
+
+}
+
+gen_ts > anastasis-data.ts
+# Auto-format
+prettier -w anastasis-data.ts

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]