diff --git a/src/app/commands/build.rs b/src/app/commands/build.rs index 2e9161d..c3fe698 100644 --- a/src/app/commands/build.rs +++ b/src/app/commands/build.rs @@ -1,6 +1,6 @@ use super::executions::build_execution::BuildExecution; -pub fn build() -> () { +pub async fn build() -> () { let mut build_execution = BuildExecution::new(); - build_execution.execute().expect("build failed") + build_execution.execute().await.expect("build failed") } diff --git a/src/app/commands/executions/build_execution.rs b/src/app/commands/executions/build_execution.rs index dd466f9..8604cc0 100644 --- a/src/app/commands/executions/build_execution.rs +++ b/src/app/commands/executions/build_execution.rs @@ -25,14 +25,14 @@ impl BuildExecution { }; } - pub fn execute(&mut self) -> Result<(), String> { + pub async fn execute(&mut self) -> Result<(), String> { let path = "./docs/".to_string(); if !Self::directory_exists(&path) { return Err("docs directory does not exist it. Create it or use the template".to_string()) } - if let Err(error) = Self::prepare() { + if let Err(error) = Self::prepare().await { return Err(error); } @@ -100,7 +100,7 @@ impl BuildExecution { self.build_file_and_status(&self.doc_builder, in_path, out_path, "doc"); } - fn prepare() -> Result<(), String> { + async fn prepare() -> Result<(), String> { let reveal_version = "3.9.2"; let target = format!("https://github.com/hakimel/reveal.js/archive/{reveal_version}.zip"); diff --git a/src/app/commands/install_reveal.rs b/src/app/commands/install_reveal.rs index de38a0f..01569d0 100644 --- a/src/app/commands/install_reveal.rs +++ b/src/app/commands/install_reveal.rs @@ -4,7 +4,7 @@ use crate::app::fs_util; const ASCIIDOC_REVEAL_VERSION: &str= "v4.1.0-rc.5"; -pub fn install_reveal() -> () { +pub async fn install_reveal() -> () { let result = reqwest::blocking::get(url()) .expect("Could not download reveal. Make sure you are connected to the internet");