Update copy_types script.

This commit is contained in:
Dessalines 2023-06-06 09:05:14 -04:00
parent c758d480dc
commit ea0c112520

View file

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