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

Package index optimization #5

Merged
merged 11 commits into from
Mar 26, 2024
84 changes: 73 additions & 11 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ petgraph = { version = "0.6", features = ["serde-1"] }
thiserror = "1.0"
miette = { version = "5.10", features = ["fancy"] }
colored = "2.0"
indicatif = { version = "0.17.3", features = ["improved_unicode", "tokio"] }
indicatif = { version = "0.17.8", features = ["improved_unicode", "tokio"] }

# async runtime and helpers
futures = "0.3"
Expand All @@ -40,6 +40,9 @@ directories = "5.0"
steamlocate = "2.0.0-alpha.0"

sysinfo = "0.29"
chrono = { version = "0.4.35", features = ["serde"] }
log = "0.4.21"
rayon = "1.9.0"

[target.'cfg(windows)'.dependencies]
winreg = "0.50"
8 changes: 8 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ pub enum Commands {
/// Path of the project configuration file.
#[clap(long, default_value = "./")]
project_path: PathBuf,

/// Syncronize the local and remote package index.
#[clap(long)]
sync: bool,
},

/// Removes a mod from the project.
Expand All @@ -154,6 +158,10 @@ pub enum Commands {
// Path of the project configuration file.
#[clap(long, default_value = "./")]
project_path: PathBuf,

/// Syncronize the local and remote package index.
#[clap(long)]
sync: bool,
},

/// Imports a new game for use by tcli.
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,29 @@ async fn main() -> Result<(), Error> {
Commands::Add {
packages,
project_path,
sync,
} => {
ts::init_repository("https://thunderstore.io", None);

let reporter = Box::new(IndicatifReporter);

let project = Project::open(&project_path)?;
project.add_packages(&packages[..])?;
project.commit(reporter).await?;
project.commit(reporter, sync).await?;

Ok(())
}
Commands::Remove {
packages,
project_path,
sync,
} => {
ts::init_repository("https://thunderstore.io", None);
let reporter = Box::new(IndicatifReporter);

let project = Project::open(&project_path)?;
project.remove_packages(&packages[..])?;
project.commit(reporter).await?;
project.commit(reporter, sync).await?;

Ok(())
}
Expand Down
Loading
Loading