Skip to content
Draft
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
118 changes: 114 additions & 4 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ tokio = { version = "1.44", features = [
"macros",
"process",
"rt-multi-thread",
"net",
] }
tokio-util = { version = "0.7", features = ["io"] }
tokio-tungstenite = "0.28"
async-compression = { version = "0.4", features = ["futures-io", "gzip"] }

# parsers, serializations, and other data processing
Expand Down
20 changes: 8 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#![allow(dead_code)]

use std::{env, io};
use std::env;
use std::path::PathBuf;
use std::sync::Arc;

use clap::Parser;
use cli::{ExternSubcommand, InitSubcommand};
Expand All @@ -11,7 +12,6 @@ use once_cell::sync::Lazy;
use project::error::ProjectError;
use project::ProjectKind;
use ts::error::ApiError;
use ts::v1::models::ecosystem::GamePlatform;
use wildmatch::WildMatch;

use crate::cli::{Args, Commands, ListSubcommand};
Expand All @@ -23,8 +23,7 @@ use crate::package::Package;
use crate::project::lock::LockFile;
use crate::project::overrides::ProjectOverrides;
use crate::project::Project;
use crate::ts::experimental;
use crate::ui::reporter::IndicatifReporter;
use crate::ui::progress::{self, TerminalSink};

mod cli;
mod config;
Expand Down Expand Up @@ -155,12 +154,11 @@ async fn main() -> Result<(), Error> {
sync,
} => {
ts::init_repository("https://thunderstore.io", None);

let reporter = Box::new(IndicatifReporter);
progress::set_sink(Arc::new(TerminalSink::new()));

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

Ok(())
}
Expand All @@ -170,11 +168,11 @@ async fn main() -> Result<(), Error> {
sync,
} => {
ts::init_repository("https://thunderstore.io", None);
let reporter = Box::new(IndicatifReporter);
progress::set_sink(Arc::new(TerminalSink::new()));

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

Ok(())
}
Expand Down Expand Up @@ -356,9 +354,7 @@ async fn main() -> Result<(), Error> {
}
},
Commands::Server { project_path } => {
let read = io::stdin();
let write = io::stdout();
server::spawn(read, write, &project_path).await?;
server::spawn_stdio(&project_path).await?;

Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions src/package/install/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum FileAction {
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct TrackedFile {
pub struct LinkedFile {
pub action: FileAction,
pub path: PathBuf,
pub context: Option<String>,
Expand Down Expand Up @@ -48,7 +48,7 @@ pub enum Request {
package_dir: PathBuf,
state_dir: PathBuf,
staging_dir: PathBuf,
tracked_files: Vec<TrackedFile>,
tracked_files: Vec<LinkedFile>,
},
StartGame {
mods_enabled: bool,
Expand All @@ -68,7 +68,7 @@ pub enum Response {
protocol: Version,
},
PackageInstall {
tracked_files: Vec<TrackedFile>,
tracked_files: Vec<LinkedFile>,
post_hook_context: Option<String>,
},
PackageUninstall {
Expand Down
Loading
Loading