-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.rs
More file actions
31 lines (27 loc) · 945 Bytes
/
build.rs
File metadata and controls
31 lines (27 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#[cfg(not(feature = "portable"))]
fn main() {}
// Can skip this if the exe isn't portable and so won't even read them.
#[cfg(feature = "portable")]
fn main() {
use copy_to_output::copy_to_output;
use std::{env, fs};
let items_to_copy = [
"example_configs/yap_colors.toml",
"example_configs/yap_espflash_profiles.toml",
"example_configs/yap_keybinds.toml",
"example_configs/macros",
];
for file in &items_to_copy {
// Skip files that don't exist.
if !fs::exists(file).unwrap() {
continue;
}
copy_to_output(file, &env::var("PROFILE").unwrap())
.unwrap_or_else(|_| panic!("Could not copy {file}"));
}
// Don't need to invalidate anything presently,
// as all current files are read by the app after being compiled and ran.
// for file in &items_to_copy {
// println!("cargo:rerun-if-changed={file}");
// }
}