1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-07 19:31:42 +00:00

Don't take a HighlightingAssets detour to build assets (#1802)

Move code to build assets to its own file. That results in better modularity and flexibility.

It also allows us to simplify HighlightingAssets a lot, since it will now always
be initialized with a SerializedSyntaxSet.
This commit is contained in:
Martin Nordholts
2021-08-24 07:58:03 +02:00
committed by GitHub
parent 12dfbdc400
commit f1c0fd7343
5 changed files with 112 additions and 139 deletions
+1 -2
View File
@@ -50,8 +50,7 @@ fn build_assets(matches: &clap::ArgMatches) -> Result<()> {
let blank = matches.is_present("blank");
let assets = bat::assets::HighlightingAssets::from_files(source_dir, !blank)?;
assets.save_to_cache(target_dir, clap::crate_version!())
bat::assets::build(source_dir, !blank, target_dir, clap::crate_version!())
}
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {