Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow overriding resource directory at compile-time #11241

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/tauri-utils/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ fn is_cargo_output_directory(path: &std::path::Path) -> bool {
/// On iOS, it's `${exe_dir}/assets`.
///
/// Android uses a special URI prefix that is resolved by the Tauri file system plugin `asset://localhost/`
///
/// Additionally, the resource directory can be overriden by setting the `TAURI_RESOURCE_DIR` environment variable at compile time.
pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<PathBuf> {
if let Some(dir) = option_env!("TAURI_RESOURCE_DIR") {
griffi-gh marked this conversation as resolved.
Show resolved Hide resolved
return Ok(PathBuf::from(format!("{}/{}", dir, package_info.name)));
}
#[cfg(target_os = "android")]
return resource_dir_android(package_info, env);
#[cfg(not(target_os = "android"))]
Expand Down
Loading