diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e67cfb5..c48e9a3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,22 +1,22 @@ -name: Rust +# name: Rust -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] +# on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] -env: - CARGO_TERM_COLOR: always +# env: +# CARGO_TERM_COLOR: always -jobs: - build: +# jobs: +# build: - runs-on: ubuntu-latest +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Билдим крейт - run: cargo build --verbose - # - name: Run tests - # run: cargo test --verbose +# steps: +# - uses: actions/checkout@v3 +# - name: Билдим крейт +# run: cargo build --verbose +# # - name: Run tests +# # run: cargo test --verbose diff --git a/.vscode/settings.json b/.vscode/settings.json index 4d9636b..780025b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,10 @@ { - "rust-analyzer.showUnlinkedFileNotification": false + "rust-analyzer.showUnlinkedFileNotification": false, + "cSpell.words": [ + "Datapack", + "Datapacks", + "modrinth", + "Purpur", + "tempfile" + ] } \ No newline at end of file diff --git a/src/config/errors.rs b/src/config/errors.rs index e6251d6..a428f45 100644 --- a/src/config/errors.rs +++ b/src/config/errors.rs @@ -2,7 +2,7 @@ use thiserror::Error; #[derive(Error, Debug)] pub enum DownloadErrors { #[error("Загрузка прекращенна потому что: {0}")] - DownloadCorrapt(String), + DownloadCorrupt(String), } #[derive(Error, Debug)] diff --git a/src/config/mod.rs b/src/config/mod.rs index e1f61f1..69cc1a9 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -7,10 +7,9 @@ mod version; use datapack::*; use errors::*; use log::{error, info}; -use models::{vanila::Vanilla, *}; +use models::{vanilla::Vanilla, *}; use plugin::Plugin; use serde::{Deserialize, Serialize}; -use tempfile::Builder; use tokio::fs; use version::Versions; @@ -85,50 +84,50 @@ impl Config { async fn download_core(self) -> Result, DownloadErrors> { match self.version { //Download purpur - Versions::Purpur(ver, freez) => { - if freez { + Versions::Purpur(ver, freeze) => { + if freeze { //We don't need to download return Ok(None); } //use if error - Err(DownloadErrors::DownloadCorrapt("ff".to_string())) + Err(DownloadErrors::DownloadCorrupt("ff".to_string())) } //Download paper - Versions::Paper(ver, freez) => { - if freez { + Versions::Paper(ver, feeze) => { + if feeze { //We don't need to download return Ok(None); } //use if error - Err(DownloadErrors::DownloadCorrapt("ff".to_string())) + Err(DownloadErrors::DownloadCorrupt("ff".to_string())) } //Download Spigot - Versions::Spigot(ver, freez) => { - if freez { + Versions::Spigot(ver, freeze) => { + if freeze { //We don't need to download return Ok(None); } //use if error - Err(DownloadErrors::DownloadCorrapt("ff".to_string())) + Err(DownloadErrors::DownloadCorrupt("ff".to_string())) } //Download Bucket - Versions::Bucket(ver, freez) => { - if freez { + Versions::Bucket(ver, freeze) => { + if freeze { //We don't need to download return Ok(None); } //use if error - Err(DownloadErrors::DownloadCorrapt("ff".to_string())) + Err(DownloadErrors::DownloadCorrupt("ff".to_string())) } - //Download Vanila - Versions::Vanila(ver, freez) => { - if freez { + //Download Vanilla + Versions::Vanilla(ver, freeze) => { + if freeze { //We don't need to download return Ok(None); } //use if error - // Err(DownloadErrors::DownloadCorrapt("ff".to_string())) - // let tmp_dir = Builder::new().tempdir().map_err(|er| ConfigErrors::LoadCorrapt(er.to_string())); + // Err(DownloadErrors::DownloadCorrupt("ff".to_string())) + // let tmp_dir = Builder::new().temp().map_err(|er| ConfigErrors::LoadCorrupt(er.to_string())); let _ = match Vanilla::find(&*ver).await { Ok(_) => {} Err(e) => { diff --git a/src/config/models/mod.rs b/src/config/models/mod.rs index 6ed2847..d7a20cf 100644 --- a/src/config/models/mod.rs +++ b/src/config/models/mod.rs @@ -1,2 +1,2 @@ pub mod item; -pub mod vanila; +pub mod vanilla; diff --git a/src/config/models/vanila.rs b/src/config/models/vanilla.rs similarity index 100% rename from src/config/models/vanila.rs rename to src/config/models/vanilla.rs diff --git a/src/config/version.rs b/src/config/version.rs index cbace31..e75e936 100644 --- a/src/config/version.rs +++ b/src/config/version.rs @@ -14,11 +14,11 @@ pub enum Versions { Paper(String, bool), Spigot(String, bool), Bucket(String, bool), - Vanila(String, bool), + Vanilla(String, bool), } impl Default for Versions { fn default() -> Self { - Versions::Vanila("latest".to_string(), false) + Versions::Vanilla("latest".to_string(), false) } }