From ea0c112520f483cf3e9b60a741084235ec124d88 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 6 Jun 2023 09:05:14 -0400 Subject: [PATCH] Update copy_types script. --- copy_generated_types_from_lemmy.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/copy_generated_types_from_lemmy.sh b/copy_generated_types_from_lemmy.sh index 662befe..1acc1ab 100755 --- a/copy_generated_types_from_lemmy.sh +++ b/copy_generated_types_from_lemmy.sh @@ -1,7 +1,7 @@ #!/bin/bash # First re-generate the types by running cargo test on lemmy -cd ../lemmy/scripts +pushd ../lemmy/scripts ./test.sh cd ../crates @@ -13,7 +13,13 @@ cp db_views/bindings/* ../../lemmy-js-client/src/types/ cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/ cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/ -# Change all the bigints to numbers -find ../../lemmy-js-client/src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} + +popd + +# Remove the Sensitive type +rm src/types/Sensitive.ts + +# Change all the bigints to numbers +find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} + + +node putTypesInIndex.js -node ../../lemmy-js-client/putTypesInIndex.js