feat: fixed file management
This commit is contained in:
parent
36c782a564
commit
5083e2ba9b
12 changed files with 148 additions and 43 deletions
|
@ -1,7 +1,8 @@
|
|||
use std::collections::HashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Bin {
|
||||
pub root: String,
|
||||
|
||||
pub checksums: HashMap<String, String>
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::{collections::HashMap, str::FromStr};
|
||||
|
||||
pub mod package;
|
||||
pub mod fs;
|
||||
|
@ -18,6 +18,22 @@ pub struct Manifest<P = Option<pkgr::PKGR>> {
|
|||
pub pkgr: P
|
||||
}
|
||||
|
||||
impl<T> Manifest<T> {
|
||||
pub fn valid(&self) -> bool {
|
||||
if self.bin.is_none() && self.build.is_none() {
|
||||
return false
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Manifest {
|
||||
type Err = toml::de::Error;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
toml::from_str(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Manifest {
|
||||
fn default() -> Self {
|
||||
Manifest {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue