mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
10
generate.sh
10
generate.sh
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Generate Client
|
||||
rm src/apis src/models docs -rf
|
||||
|
||||
./node_modules/\@openapitools/openapi-generator-cli/main.js generate \
|
||||
-g rust \
|
||||
--additional-properties=packageName=vrchatapi,supportAsync=false \
|
||||
--additional-properties=packageName=vrchatapi,supportAsync=true \
|
||||
--git-user-id=vrchatapi \
|
||||
--git-repo-id=vrchatapi-rust \
|
||||
-o . \
|
||||
@ -25,6 +25,10 @@ find src -type f -exec sed -i '/^\s*\/\/\/\s*$/d' {} \;
|
||||
|
||||
# Cookie storage
|
||||
sed -i 's/Client::new()/Client::builder().cookie_store(true).build().unwrap()/g' src/apis/configuration.rs
|
||||
sed -i 's/features = \["json", "blocking", "multipart"\]/features = \["json", "blocking", "cookies", "multipart"\]/g' Cargo.toml
|
||||
sed -i 's/features = \["json", "multipart"\]/features = \["json", "cookies", "multipart"\]/g' Cargo.toml
|
||||
|
||||
#Fix example
|
||||
printf "\n[dev-dependencies]\ntokio = { version = '1', features = ['macros', 'rt-multi-thread'] }" >> Cargo.toml
|
||||
|
||||
cargo build
|
||||
cargo test
|
||||
|
Reference in New Issue
Block a user