feat: multiline logging
All checks were successful
/ check (push) Successful in 38s

This commit is contained in:
Didier Slof 2023-07-19 16:15:26 +02:00
parent b115b91ecb
commit e4eb85f535
Signed by: didier
GPG key ID: 01E71F18AA4398E5
7 changed files with 75 additions and 38 deletions

View file

@ -37,8 +37,8 @@ pub enum InstallError {
impl ToString for InstallError {
fn to_string(&self) -> String {
match self {
InstallError::BuildError(e) => format!("Build error: {}", e),
InstallError::BinError(e) => format!("Bin error: {}", e),
InstallError::BuildError(e) => format!("Build error: \n{}", e),
InstallError::BinError(e) => format!("Bin error: \n{}", e),
InstallError::InvalidManifest => "Invalid manifest".to_string(),
InstallError::Generic => "Install error".to_string(),
}

View file

@ -38,7 +38,10 @@ impl PackageInstaller {
return Err(BinError::UnpackError("package has no data".to_string()));
}
if std::path::Path::new(&path).exists() {
return Err(BinError::UnpackError("path already exists".to_string()));
return Err(BinError::UnpackError(format!(
"path already exists: {}",
path
)));
}
tar::Archive::new(self.pkgfile.data.as_slice())
.unpack(&path)