1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-22 16:53:19 +00:00

Fix compilation of library

This commit is contained in:
sharkdp
2020-04-21 17:19:07 +02:00
committed by David Peter
parent 886b22e0ee
commit 2e9cf63a5f
5 changed files with 11 additions and 12 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pub fn clear_assets() {
pub fn assets_from_cache_or_binary() -> Result<HighlightingAssets> {
let cache_dir = PROJECT_DIRS.cache_dir();
if let Some(metadata) = AssetsMetadata::load_from_folder(&cache_dir)? {
if !metadata.is_compatible() {
if !metadata.is_compatible_with(crate_version!()) {
return Err(format!(
"The binary caches for the user-customized syntaxes and themes \
in '{}' are not compatible with this version of bat ({}). To solve this, \
+3 -3
View File
@@ -22,13 +22,13 @@ use crate::{
config::{config_file, generate_config_file},
};
use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir};
use bat::Controller;
use clap::crate_version;
use directories::PROJECT_DIRS;
use bat::{
config::{Config, InputFile, OrdinaryFile, StyleComponent, StyleComponents},
errors::*,
HighlightingAssets,
Controller, HighlightingAssets,
};
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
@@ -45,7 +45,7 @@ fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
let blank = matches.is_present("blank");
let assets = HighlightingAssets::from_files(source_dir, !blank)?;
assets.save_to_cache(target_dir)?;
assets.save_to_cache(target_dir, crate_version!())?;
} else if matches.is_present("clear") {
clear_assets();
}