Merge pull request #2515 from tranzystorek-io/custom-asset-gen-dir

Allow customizing output directory for generated assets
This commit is contained in:
David Peter authored and GitHub committed 2023-03-25 13:18:02 +01:00
commit 1712ec9e73
2 files changed
+5 -1

No files matched your search

+2
View File
@@ -6,6 +6,8 @@
## Other
- Output directory for generated assets (completion, manual) can be customized, see #2515 (@tranzystorek-io)
## Syntaxes
## Themes
+3 -1
View File
@@ -43,7 +43,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
variables.insert("PROJECT_EXECUTABLE_UPPERCASE", &executable_name_uppercase);
variables.insert("PROJECT_VERSION", PROJECT_VERSION);
let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs");
let out_dir_env = std::env::var_os("BAT_ASSETS_GEN_DIR")
.or_else(|| std::env::var_os("OUT_DIR"))
.expect("BAT_ASSETS_GEN_DIR or OUT_DIR to be set in build.rs");
let out_dir = Path::new(&out_dir_env);
fs::create_dir_all(out_dir.join("assets/manual")).unwrap();