Replies: 1 comment
|
For a template that should be written only when the user creates a project, embed its bytes in your Rust binary and write them to the chosen destination then: fn create_project(destination: &std::path::Path) -> std::io::Result<()> {
std::fs::create_dir_all(destination)?;
std::fs::write(
destination.join("project.template"),
include_bytes!("../templates/project.template"),
)?;
Ok(())
}The example assumes this code is in If you are comfortable shipping the template as a separate app resource, Tauri also supports |
Uh oh!
There was an error while loading. Please reload this page.
How to hide resource files in an application and release them as needed? For example, to implement the function of creating a project, the project file template needs to be released to a specified directory.
All reactions