Skip to content

Commit

Permalink
hmm some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlan404 committed Jan 31, 2024
1 parent 5af5066 commit 7272124
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/app/steps.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
use std::path::PathBuf;

use anyhow::Result;
use indicatif::ProgressBar;

use super::{ResolvedFile, App};

#[derive(Debug, Clone)]
pub enum Step {
Download(DownloadTask),
ExecuteJava {
jar: String,
args: Vec<String>,
path: PathBuf,
}
}

#[derive(Debug, Clone)]
pub struct DownloadTask {
pub resolved_file: ResolvedFile,
pub path: PathBuf,
}

impl App {
pub async fn run_step(&self, step: &Step) -> Result<()> {
match step {
Step::Download(folder, resolved_file) => {
self.download_resolved(
resolved_file.clone(),
folder.clone(),
self.multi_progress.add(ProgressBar::new_spinner())
).await?;
}

Step::ExecuteJava { jar, args, path } => {
todo!();
}
}

Ok(())
}
}

0 comments on commit 7272124

Please sign in to comment.