Skip to content

Automatically rebuild custom assets when necessary #2085

Description

@Enselic

Currently, if a user makes use of custom assets and then installs a new 0.x.0 version of bat, bat will stop working. That is not an ideal user experience. It would be good if we could make this use case smoother, e.g. by automatically doing the equivalent of running bat cache --build for the user.

Step-by-step

Here is a step by step against the git repo, but regular users will get this problem too via regular releases from us and e.g. package manager updates of the bat app.

  1. cargo run -- cache --build --blank --source assets
  2. Bump 0.x.0 version in Cargo.toml, e.g. from 0.19.0 to 0.20.0
  3. cargo run -- examples/simple.rs

Expected result

bat prints examples/simple.rs

Actual result

[bat error]: The binary caches for the user-customized syntaxes and themes in
'/Users/martin/.cache/bat' are not compatible with this version of bat (0.20.0). To solve this,
either rebuild the cache (bat cache --build) or remove the custom syntaxes/themes (bat
cache --clear).
For more information, see:

  https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions