1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-02-20 20:08:58 +00:00

Work around cargo vendor losing syntax_mapping builtins directory

This commit is contained in:
David Tolnay 2025-01-17 21:18:12 -08:00
parent 33aabc696a
commit db7da314e7
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 10 additions and 2 deletions

View File

@ -7,6 +7,8 @@
## Other
- Work around build failures when building `bat` from vendored sources #3179 (@dtolnay)
## Syntaxes
## Themes

View File

@ -236,8 +236,14 @@ fn get_def_paths() -> anyhow::Result<Vec<PathBuf>> {
];
let mut toml_paths = vec![];
for subdir in source_subdirs {
let wd = WalkDir::new(Path::new("src/syntax_mapping/builtins").join(subdir));
for subdir_name in source_subdirs {
let subdir = Path::new("src/syntax_mapping/builtins").join(subdir_name);
if !subdir.try_exists()? {
// Directory might not exist due to this `cargo vendor` bug:
// https://github.com/rust-lang/cargo/issues/15080
continue;
}
let wd = WalkDir::new(subdir);
let paths = wd
.into_iter()
.filter_map_ok(|entry| {