update dependecies

This commit is contained in:
ALEZ-DEV 2024-05-05 17:31:32 +02:00
parent 085f12138b
commit 3f0086287a
10 changed files with 27 additions and 32 deletions

View File

@ -62,7 +62,7 @@ name = "babylonia-terminal-cli"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"babylonia-terminal-sdk", "babylonia-terminal-sdk",
"downloader-for-babylonia-terminal", "downloader",
"indicatif", "indicatif",
"log", "log",
"simple_logger", "simple_logger",
@ -73,14 +73,12 @@ dependencies = [
[[package]] [[package]]
name = "babylonia-terminal-sdk" name = "babylonia-terminal-sdk"
version = "0.1.0" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "356e615d4d99673511c7c55cd7ac410996a69e3930e9ac50b0570cfefb05e68e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chksum-md5", "chksum-md5",
"dirs", "dirs",
"dotenv", "dotenv",
"downloader-for-babylonia-terminal", "downloader",
"flate2", "flate2",
"fs_extra", "fs_extra",
"log", "log",
@ -339,10 +337,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]] [[package]]
name = "downloader-for-babylonia-terminal" name = "downloader"
version = "0.1.0" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/ALEZ-DEV/downloader#5572a0875ec4f04b0514342f9acff21252beb579"
checksum = "075dd494fe6741db4ecbd43fde70a104bebd4592dbe8a9efce1d7072e20b9da5"
dependencies = [ dependencies = [
"futures", "futures",
"rand", "rand",

View File

@ -14,9 +14,8 @@ name = "babylonia-terminal-cli"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
babylonia-terminal-sdk = "0.1.0" # { path = "./../babylonia-terminal-sdk" } babylonia-terminal-sdk = { path = "./../babylonia-terminal-sdk" }
# downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7", downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
downloader-for-babylonia-terminal = "0.1.0"
indicatif = "0.17.8" indicatif = "0.17.8"
log = "0.4.21" log = "0.4.21"
simple_logger = "4.3.3" simple_logger = "4.3.3"

View File

@ -23,7 +23,7 @@ impl DownloadReporter {
} }
} }
impl downloader_for_babylonia_terminal::progress::Reporter for DownloadReporter { impl downloader::progress::Reporter for DownloadReporter {
fn setup(&self, max_progress: Option<u64>, message: &str) { fn setup(&self, max_progress: Option<u64>, message: &str) {
let pb = ProgressBar::new(max_progress.unwrap()); let pb = ProgressBar::new(max_progress.unwrap());
pb.set_style(ProgressStyle::with_template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.white}] {bytes}/{total_bytes} ({eta})") pb.set_style(ProgressStyle::with_template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.white}] {bytes}/{total_bytes} ({eta})")

View File

@ -65,7 +65,7 @@ dependencies = [
"chksum-md5", "chksum-md5",
"dirs", "dirs",
"dotenv", "dotenv",
"downloader-for-babylonia-terminal", "downloader",
"flate2", "flate2",
"fs_extra", "fs_extra",
"log", "log",
@ -292,10 +292,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]] [[package]]
name = "downloader-for-babylonia-terminal" name = "downloader"
version = "0.1.0" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/ALEZ-DEV/downloader#5572a0875ec4f04b0514342f9acff21252beb579"
checksum = "075dd494fe6741db4ecbd43fde70a104bebd4592dbe8a9efce1d7072e20b9da5"
dependencies = [ dependencies = [
"futures", "futures",
"rand", "rand",

View File

@ -15,7 +15,7 @@ anyhow = "1.0.81"
chksum-md5 = { version = "0.0.0", features = ["reader"] } chksum-md5 = { version = "0.0.0", features = ["reader"] }
dirs = "5.0.1" dirs = "5.0.1"
dotenv = "0.15.0" dotenv = "0.15.0"
downloader-for-babylonia-terminal = "0.1.0" # { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7", downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
flate2 = "1.0.28" flate2 = "1.0.28"
fs_extra = "1.3.0" fs_extra = "1.3.0"
log = "0.4.21" log = "0.4.21"

View File

@ -1,6 +1,6 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use downloader_for_babylonia_terminal::progress::Reporter; use downloader::progress::Reporter;
pub trait ComponentDownloader { pub trait ComponentDownloader {
#[allow(async_fn_in_trait)] #[allow(async_fn_in_trait)]

View File

@ -3,7 +3,7 @@ use std::{
path::PathBuf, path::PathBuf,
}; };
use downloader_for_babylonia_terminal::Downloader; use downloader::Downloader;
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
use tar::Archive; use tar::Archive;
use tokio::fs::remove_dir_all; use tokio::fs::remove_dir_all;
@ -33,7 +33,7 @@ impl<'a> DXVKComponent<'a> {
impl<'a> GithubRequester for DXVKComponent<'a> {} impl<'a> GithubRequester for DXVKComponent<'a> {}
impl<'a> ComponentDownloader for DXVKComponent<'a> { impl<'a> ComponentDownloader for DXVKComponent<'a> {
async fn install<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>( async fn install<P: downloader::progress::Reporter + 'static>(
&self, &self,
progress: Option<std::sync::Arc<P>>, progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
@ -63,7 +63,7 @@ impl<'a> ComponentDownloader for DXVKComponent<'a> {
Ok(()) Ok(())
} }
async fn download<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>( async fn download<P: downloader::progress::Reporter + 'static>(
output_dir: &std::path::PathBuf, output_dir: &std::path::PathBuf,
progress: Option<std::sync::Arc<P>>, progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<std::path::PathBuf> { ) -> anyhow::Result<std::path::PathBuf> {
@ -78,7 +78,7 @@ impl<'a> ComponentDownloader for DXVKComponent<'a> {
.download_folder(output_dir) .download_folder(output_dir)
.parallel_requests(1) .parallel_requests(1)
.build()?; .build()?;
let mut dl = downloader_for_babylonia_terminal::Download::new(&asset.browser_download_url); let mut dl = downloader::Download::new(&asset.browser_download_url);
if let Some(p) = progress { if let Some(p) = progress {
dl = dl.progress(p); dl = dl.progress(p);
} }

View File

@ -4,7 +4,7 @@ use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use std::vec; use std::vec;
use downloader_for_babylonia_terminal::Downloader; use downloader::Downloader;
use log::debug; use log::debug;
use log::info; use log::info;
use tokio::fs::{create_dir_all, remove_file}; use tokio::fs::{create_dir_all, remove_file};
@ -60,7 +60,7 @@ impl GameComponent {
Ok(to_download) Ok(to_download)
} }
fn update_progress<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>( fn update_progress<P: downloader::progress::Reporter + 'static>(
progress: Arc<P>, progress: Arc<P>,
max_size: u64, max_size: u64,
game_dir: PathBuf, game_dir: PathBuf,
@ -93,7 +93,7 @@ impl GameComponent {
impl GithubRequester for GameComponent {} impl GithubRequester for GameComponent {}
impl ComponentDownloader for GameComponent { impl ComponentDownloader for GameComponent {
async fn install<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>( async fn install<P: downloader::progress::Reporter + 'static>(
&self, &self,
progress: Option<std::sync::Arc<P>>, progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
@ -103,7 +103,7 @@ impl ComponentDownloader for GameComponent {
Ok(()) Ok(())
} }
async fn download<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>( async fn download<P: downloader::progress::Reporter + 'static>(
output_dir: &std::path::PathBuf, output_dir: &std::path::PathBuf,
progress: Option<std::sync::Arc<P>>, progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<std::path::PathBuf> { ) -> anyhow::Result<std::path::PathBuf> {
@ -154,7 +154,7 @@ impl ComponentDownloader for GameComponent {
&game_info.get_resource_base_path(), &game_info.get_resource_base_path(),
); );
debug!("starting download for {}", url); debug!("starting download for {}", url);
let mut dl = downloader_for_babylonia_terminal::Download::new_with_output( let mut dl = downloader::Download::new_with_output(
&url, &url,
output_path output_path
.get(i) .get(i)
@ -165,7 +165,7 @@ impl ComponentDownloader for GameComponent {
dl dl
}) })
.collect::<Vec<downloader_for_babylonia_terminal::Download>>(); .collect::<Vec<downloader::Download>>();
downloader.async_download(&to_download).await?; downloader.async_download(&to_download).await?;
} }

View File

@ -5,7 +5,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use downloader_for_babylonia_terminal::{progress::Reporter, Downloader}; use downloader::{progress::Reporter, Downloader};
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
use log::debug; use log::debug;
use tar::Archive; use tar::Archive;
@ -54,7 +54,7 @@ impl ComponentDownloader for ProtonComponent {
.parallel_requests(1) .parallel_requests(1)
.build()?; .build()?;
let mut dl = downloader_for_babylonia_terminal::Download::new(&asset.browser_download_url); let mut dl = downloader::Download::new(&asset.browser_download_url);
if let Some(p) = progress { if let Some(p) = progress {
dl = dl.progress(p); dl = dl.progress(p);
} }

View File

@ -1,6 +1,6 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use downloader_for_babylonia_terminal::progress::Reporter; use downloader::progress::Reporter;
use log::{debug, info}; use log::{debug, info};
use tokio::fs::create_dir_all; use tokio::fs::create_dir_all;
use wincompatlib::prelude::*; use wincompatlib::prelude::*;