mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
28 lines
924 B
Bash
Executable File
28 lines
924 B
Bash
Executable File
#!/bin/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 \
|
|
--git-user-id=vrchatapi \
|
|
--git-repo-id=vrchatapi-rust \
|
|
-o . \
|
|
-i https://vrchatapi.github.io/specification/openapi.yaml \
|
|
--http-user-agent="vrchatapi-rust"
|
|
|
|
# Add license and description to Cargo.toml
|
|
sed -i '/^edition = "2018"/i license = "MIT"' Cargo.toml
|
|
sed -i '/^edition = "2018"/a description="VRChat API Library for Rust"' Cargo.toml
|
|
|
|
# Remove messily pasted markdown at top of every file
|
|
find src -type f -exec sed -i '/VRChat API Banner/d' {} \;
|
|
# Remove openapi version in every file
|
|
find src -type f -exec sed -i '/The version of the OpenAPI document/d' {} \;
|
|
|
|
# Cookie storage
|
|
sed -i 's/Client::new()/Client::builder().cookie_store(true).build().unwrap()/g' src/apis/configuration.rs
|
|
|
|
cargo build
|