Обновление README.md, исходников, пакетки
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
use crate::utils::fs::hardcopy::hardcopy_handler;
|
||||
use crate::utils::shell::*;
|
||||
|
||||
pub fn link(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
pub fn link(repo: &String, pkgname: &String) {
|
||||
let source = crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
||||
if source.join("disabled").exists() { println!("Can't link disabled package: {}", &pkgname); return Ok(()) }
|
||||
if source.join("disabled").exists() { println!("Disabled package, no linking: {}\nUse `pkg enable {}` to link", pkgname, pkgname); return }
|
||||
|
||||
let destination = source.parent()
|
||||
.ok_or("Failed to get parent directory for path")?
|
||||
.ok_or("Failed to get parent directory for path").unwrap()
|
||||
.to_path_buf();
|
||||
|
||||
let dirs_to_copy = vec![
|
||||
@ -24,12 +24,10 @@ pub fn link(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
|
||||
if src.exists() {
|
||||
hardcopy_handler(&src, &dest)
|
||||
.map_err(|e| format!("Failed to copy {} to {}: {}", src.display(), dest.display(), e))?;
|
||||
.map_err(|e| format!("Failed to copy {} to {}: {}", src.display(), dest.display(), e)).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
mount_overlay(&destination)?;
|
||||
shell_update()?;
|
||||
|
||||
Ok(())
|
||||
mount_overlay();
|
||||
shell_update()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user