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
This commit is contained in:
darth-coder00 2021-11-23 21:42:25 +05:30 committed by GitHub
parent f6dfc62a4b
commit 4fa46156cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}