Skip to content

Commit

Permalink
Work around cargo vendor losing syntax_mapping builtins directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 18, 2025
1 parent 33aabc6 commit db7da31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

## Other

- Work around build failures when building `bat` from vendored sources #3179 (@dtolnay)

## Syntaxes

## Themes
Expand Down
10 changes: 8 additions & 2 deletions build/syntax_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down

0 comments on commit db7da31

Please sign in to comment.