diff --git a/src/formula.rs b/src/formula.rs index e00c1f9..01c90ab 100644 --- a/src/formula.rs +++ b/src/formula.rs @@ -4,6 +4,7 @@ use crate::cask; use crate::git; use crate::hooker; +use std::collections::HashMap; use std::fs::File; use std::io::{ErrorKind, Read}; use std::path::Path; @@ -31,8 +32,8 @@ pub struct Formula { pub windows: Option, // The windows target information pub darwin: Option, // The macOS target information pub linux: Option, // The linux target information - pub dependencies: Option>, // TODO: The dependencies will be installed before install package - pub hook: Option, // The hook should run in some moment + pub dependencies: Option>, // TODO: The dependencies of the package + pub hook: Option, // The hook should run in some moment } #[derive(Deserialize, Serialize)] @@ -43,6 +44,17 @@ pub struct Cask { pub repository: String, // The package installed from the repository url } +#[derive(Deserialize, Serialize)] +pub enum Dependencies { + Detail(DependenciesDetail), // More information of package + Simple(String), // The version of package +} + +#[derive(Deserialize, Serialize)] +pub struct DependenciesDetail { + pub version: String, // The version of package +} + #[derive(Deserialize, Serialize)] pub struct Package { pub name: String, // The package name