X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=genbindings.sh;h=77c936d9da129f46eae65670109100b2b0228a68;hb=cbb0beb4b0d98b743f600c154a6079c2b1463c9b;hp=6c7f6501210dd816317a58b0150488c48680b791;hpb=e498223de1e56484096f3e4d2d9f2bf0468fb328;p=ldk-java diff --git a/genbindings.sh b/genbindings.sh index 6c7f6501..77c936d9 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -180,7 +180,7 @@ if [ "$2" != "wasm" ]; then else echo "Creating TS bindings..." mkdir -p ts/{enums,structs} - rm -f ts/{enums,structs,}/*.{mjs,mts} + rm -f ts/{enums,structs,}/*.{mjs,mts,mts.part} if [ "$4" = "false" ]; then ./genbindings.py "./lightning.h" ts ts ts $DEBUG_ARG typescript node else @@ -214,7 +214,11 @@ else if [ -x "$(which tsc)" ]; then cd ts - rm -r structs # TODO: Make the human-types compile + for F in structs/*; do + cat imports.mts.part | grep -v " $(basename -s .mts $F)[ ,]" | cat - $F > $F.tmp + mv $F.tmp $F + done + rm imports.mts.part if [ "$4" = "true" ]; then tsc else