X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=genbindings.sh;h=77c936d9da129f46eae65670109100b2b0228a68;hb=bf08029c1ad5244b59902eada723b634dcade62d;hp=6c7f6501210dd816317a58b0150488c48680b791;hpb=0fee03a8095f5599f8eccd920c1b1af6b3a20260;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