Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move config.rs to a seperate crate #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions client/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ members = [
"packages/flatbuffers_structs",
"packages/protocol",
"packages/vita_reports",
"packages/vita_virtual_device",
"packages/vita_virtual_device", "packages/vitaoxipad_config",
]
6 changes: 3 additions & 3 deletions client/packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "1.3.0"
edition = "2021"

[dependencies]
config = "0.14.1"
argh = "0.1.12"
color-eyre = "0.6.3"
log = "0.4.22"
Expand All @@ -15,9 +16,8 @@ protocol = { version = "0.1.0", path = "../protocol" }
vita_reports = { version = "0.1.0", path = "../vita_reports" }
vita_virtual_device = { version = "0.1.0", path = "../vita_virtual_device" }
serde = { version = "1.0.216", features = ["derive"] }
config = "0.14.1"
toml = "0.8.19"
home = "0.5.9"
vitaoxipad_config = { path = "../vitaoxipad_config" }


[build-dependencies]
build-data = "0.2.1"
6 changes: 3 additions & 3 deletions client/packages/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use flatbuffers_structs::net_protocol::{ConfigArgs, Endpoint, HandshakeArgs};
use protocol::connection::Connection;
use vita_virtual_device::{VitaDevice, VitaVirtualDevice};

mod config;
use vitaoxipad_config::*;

/// Create a virtual controller and fetch its data from a Vita
/// over the network.
Expand Down Expand Up @@ -68,10 +68,10 @@ fn main() -> color_eyre::Result<()> {
// Do not load existing config while printing sample config
if !args.sample_config {
// Load existing config if any
config = config::load_config().wrap_err("Failed to load configuration")?;
config = load_config().wrap_err("Failed to load configuration")?;
} else {
// Show sample configuration
config::print_sample_config();
print_sample_config();
return Ok(());
}

Expand Down
11 changes: 11 additions & 0 deletions client/packages/vitaoxipad_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "vitaoxipad_config"
version = "0.1.0"
edition = "2021"

[dependencies]
config = "0.14.1"
toml = "0.8.19"
home = "0.5.9"
serde = { version = "1.0.216", features = ["derive"] }
color-eyre = "0.6.3"
Loading