From 4fa46156cc70d728babce02f2f506a29e0eb4104 Mon Sep 17 00:00:00 2001 From: darth-coder00 <86726556+darth-coder00@users.noreply.github.com> Date: Tue, 23 Nov 2021 21:42:25 +0530 Subject: [PATCH] Bugfix: Updated json2ts script to avoid empty files from generating (#1342) * Bugfix: Updated json2ts script to avoid empty files from generating * Added TS generation script to build script * Removing json2ts from build script --- catalog-rest-service/src/main/resources/ui/json2ts.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/catalog-rest-service/src/main/resources/ui/json2ts.sh b/catalog-rest-service/src/main/resources/ui/json2ts.sh index fc38a3d3b87..fc387703333 100755 --- a/catalog-rest-service/src/main/resources/ui/json2ts.sh +++ b/catalog-rest-service/src/main/resources/ui/json2ts.sh @@ -34,7 +34,12 @@ getTypes(){ fileTS=${f//.json/.ts} fileTS=${fileTS//$2/$3} mkdir -p "$(dirname "$fileTS")" && quicktype -s schema "$f" -o "$fileTS" --just-types - addLicensing "$fileTS" + if [[ -s $fileTS ]] + then + addLicensing "$fileTS" + else + rm -f $fileTS + fi fi done }