This commit is contained in:
parent
66ac061630
commit
6ee1500795
2 changed files with 38 additions and 6 deletions
|
@ -280,6 +280,23 @@ impl Package {
|
|||
.collect()
|
||||
}
|
||||
|
||||
pub fn readmes(&self) -> Vec<(String, String)> {
|
||||
let pkg_file = self.base_path().join(self.file_name());
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| {
|
||||
let file_name = x.split("/").last().unwrap();
|
||||
let cleaned = file_name.trim_end_matches(".md").trim_end_matches(".txt");
|
||||
cleaned == "README"
|
||||
})
|
||||
.map(|x| {
|
||||
let content = read_file_tar(&pkg_file, &x).unwrap();
|
||||
(x, content)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn pacman_hooks(&self) -> Vec<(String, String)> {
|
||||
let pkg_file = self.base_path().join(self.file_name());
|
||||
let files = self.file_list();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue