Skip to content

Commit

Permalink
Merge pull request #2515 from tranzystorek-io/custom-asset-gen-dir
Browse files Browse the repository at this point in the history
Allow customizing output directory for generated assets
  • Loading branch information
sharkdp committed Mar 25, 2023
2 parents c7905a6 + 3ca8c43 commit 1712ec9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

## Other

- Output directory for generated assets (completion, manual) can be customized, see #2515 (@tranzystorek-io)

## Syntaxes

## Themes
Expand Down
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1712ec9

Please sign in to comment.