4 releases

0.1.2 Sep 2, 2024
0.1.1 Apr 1, 2024
0.1.0 Jan 28, 2024
0.0.0 Jan 28, 2024

#419 in Unix APIs

Download history 30/week @ 2024-06-26 37/week @ 2024-07-03 29/week @ 2024-07-10 15/week @ 2024-07-17 74/week @ 2024-07-24 63/week @ 2024-07-31 114/week @ 2024-08-07 62/week @ 2024-08-14 45/week @ 2024-08-21 147/week @ 2024-08-28 74/week @ 2024-09-04 57/week @ 2024-09-11 36/week @ 2024-09-18 40/week @ 2024-09-25 25/week @ 2024-10-02 44/week @ 2024-10-09

149 downloads per month

Apache-2.0 OR MIT

26KB
296 lines

cargo-packager-resource-resolver

Resource resolver for apps that was packaged by cargo-packager.

It resolves the root path which contains resources, which was set using the resources field of cargo packager configuration.

Get the resource path

use cargo_packager_resource_resolver::{resources_dir, PackageFormat};

let resource_path = resources_dir(PackageFormat::Nsis).unwrap();

Automatically detect formats

⚠️ This feature is only available for Rust apps that were built with cargo packager.

  1. Make sure to use the before_each_package_command field of cargo packager configuration to build your app (this will not work with the before_packaging_command field).
  2. Activete the feature auto-detect-format for this crate in your Cargo.toml.
use cargo_packager_resource_resolver::{resources_dir, current_format};

let resource_path = resources_dir(current_format().unwrap()).unwrap();

Licenses

MIT or MIT/Apache 2.0 where applicable.

Dependencies

~0.3–0.8MB
~19K SLoC