3 unstable releases

0.1.1 Apr 1, 2024
0.1.0 Jan 28, 2024
0.0.0 Jan 28, 2024

#352 in Build Utils

Download history 26/week @ 2024-03-12 1/week @ 2024-03-19 132/week @ 2024-03-26 99/week @ 2024-04-02 34/week @ 2024-04-09 14/week @ 2024-04-16 35/week @ 2024-04-23 20/week @ 2024-04-30 11/week @ 2024-05-07 6/week @ 2024-05-14 23/week @ 2024-05-21 83/week @ 2024-05-28 41/week @ 2024-06-04 22/week @ 2024-06-11 45/week @ 2024-06-18 24/week @ 2024-06-25

140 downloads per month

Apache-2.0 OR MIT

25KB
295 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.4–0.9MB
~20K SLoC