Downloading launcher files

This commit is contained in:
Jai A
2021-06-29 22:32:52 -07:00
commit 93418edbe7
16 changed files with 1870 additions and 0 deletions

12
theseus_cli/Cargo.toml Normal file
View File

@@ -0,0 +1,12 @@
[package]
name = "theseus_cli"
version = "0.1.0"
authors = ["Jai A <jaiagr+gpg@pm.me>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
theseus = { path = "../theseus" }
tokio = { version = "1", features = ["full"] }
futures = "0.3"

28
theseus_cli/src/main.rs Normal file
View File

@@ -0,0 +1,28 @@
use futures::{executor, future};
use std::path::Path;
#[tokio::main]
async fn main() {
let mut thing1 = theseus::launcher::meta::fetch_version_manifest()
.await
.unwrap();
// future::join_all(thing1.versions.iter().map(|x| async move {
// println!("{}", x.url);
// let version = theseus::launcher::meta::fetch_version_info(x)
// .await
// .unwrap();
//
// println!("{:?}", version);
// }))
// .await;
if let Some(version) = thing1.versions.iter().find(|x| &*x.id == "1.17") {
println!("{}", version.id);
let thing = theseus::launcher::meta::fetch_version_info(&version)
.await
.unwrap();
theseus::launcher::download::download_client(&Path::new("./versions"), &thing).await;
}
}