Skip to content

Commit

Permalink
feat: add struct of prepare dependencies. refs: #28
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 19, 2022
1 parent 41ab343 commit d0c2e97
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/formula.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -31,8 +32,8 @@ pub struct Formula {
pub windows: Option<Platform>, // The windows target information
pub darwin: Option<Platform>, // The macOS target information
pub linux: Option<Platform>, // The linux target information
pub dependencies: Option<Vec<String>>, // TODO: The dependencies will be installed before install package
pub hook: Option<hooker::Hook>, // The hook should run in some moment
pub dependencies: Option<HashMap<String, Dependencies>>, // TODO: The dependencies of the package
pub hook: Option<hooker::Hook>, // The hook should run in some moment
}

#[derive(Deserialize, Serialize)]
Expand All @@ -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
Expand Down

0 comments on commit d0c2e97

Please sign in to comment.