1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-09 19:51:48 +00:00

Include syntaxes and themes in repository

This changes a few things:

- All syntaxes and themes are now stored (as submodules) under
  assets/syntaxes and assets/themes

- The default directories for syntaxes and themes are "syntaxes"
  and "themes" (used to be "syntax" and "themes")

- The "bat cache" command can now take a `--source <dir>` and
  `--target <dir>` option.

- The cached files have been renamed to "themes.bin" and "syntaxes.bin"
This commit is contained in:
sharkdp
2018-05-16 21:22:16 +02:00
committed by David Peter
parent 9af1d2b891
commit 145b99f01c
17 changed files with 78 additions and 53 deletions
+6 -2
View File
@@ -27,6 +27,7 @@ mod terminal;
use std::fs::{self, File};
use std::io::{self, BufRead, BufReader, Write};
use std::path::Path;
use std::process::{self, Child, Command, Stdio};
#[cfg(unix)]
@@ -206,8 +207,11 @@ fn run() -> Result<()> {
match app.matches.subcommand() {
("cache", Some(cache_matches)) => {
if cache_matches.is_present("init") {
let assets = HighlightingAssets::from_files()?;
assets.save()?;
let source_dir = cache_matches.value_of("source").map(Path::new);
let target_dir = cache_matches.value_of("target").map(Path::new);
let assets = HighlightingAssets::from_files(source_dir)?;
assets.save(target_dir)?;
} else if cache_matches.is_present("clear") {
print!("Clearing theme set cache ... ");
fs::remove_file(theme_set_path()).ok();