Skip to content

Commit

Permalink
add to_kebab_case
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Jan 20, 2024
1 parent 7dd4958 commit 2e1fa2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/resource-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ features = [ "auto-detect-format" ]
thiserror.workspace = true
cargo-packager-utils.workspace = true
log = "0.4.20"
heck = "0.4.1"

[features]
process-relaunch-dangerous-allow-symlink-macos = [ ]
Expand Down
5 changes: 3 additions & 2 deletions crates/resource-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
//! ```
//!
use error::Result;
use heck::ToKebabCase;
use std::{env, path::PathBuf};

mod error;
Expand Down Expand Up @@ -115,7 +116,7 @@ pub fn resources_dir(package_format: PackageFormat) -> Result<PathBuf> {
}
PackageFormat::Deb => {
let exe = current_exe()?;
let exe_name = exe.file_name().unwrap().to_string_lossy();
let exe_name = exe.file_name().unwrap().to_string_lossy().to_kebab_case();

let path = format!("/usr/lib/{}/", exe_name);
Ok(PathBuf::from(path))
Expand Down Expand Up @@ -145,7 +146,7 @@ pub fn resources_dir(package_format: PackageFormat) -> Result<PathBuf> {
let appdir: &std::path::Path = appdir.as_ref();

let exe = current_exe()?;
let exe_name = exe.file_name().unwrap().to_string_lossy();
let exe_name = exe.file_name().unwrap().to_string_lossy().to_kebab_case();

Ok(PathBuf::from(format!(
"{}/usr/lib/{}",
Expand Down

0 comments on commit 2e1fa2d

Please sign in to comment.