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:
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user