Skip to content

Commit

Permalink
fix(resource-resolver): Add pacman support for resource resolver, closes
Browse files Browse the repository at this point in the history
 #188 (#192)

* Fix pacman support for resource resolver

* Add changes file

* Run prettier
  • Loading branch information
naman-crabnebula committed Apr 1, 2024
1 parent 2c7f9b2 commit 053b50b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/add-pacman-support-resource-resolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager-resource-resolver": patch
---

Added support for Pacman Packages in the Resource Resolver.
4 changes: 3 additions & 1 deletion crates/resource-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub fn current_format() -> crate::Result<PackageFormat> {
Ok(PackageFormat::Deb)
} else if cfg!(CARGO_PACKAGER_FORMAT = "appimage") {
Ok(PackageFormat::AppImage)
} else if cfg!(CARGO_PACKAGER_FORMAT = "pacman") {
Ok(PackageFormat::Pacman)
} else {
Err(Error::UnkownPackageFormat)
}
Expand Down Expand Up @@ -94,7 +96,7 @@ pub fn resources_dir(package_format: PackageFormat) -> Result<PathBuf> {
.ok_or_else(|| Error::ParentNotFound(exe.clone()))?;
Ok(exe_dir.to_path_buf())
}
PackageFormat::Deb => {
PackageFormat::Deb | PackageFormat::Pacman => {
let exe = current_exe()?;
let exe_name = exe.file_name().unwrap().to_string_lossy();

Expand Down

0 comments on commit 053b50b

Please sign in to comment.