Page MenuHomeSolus

update bat to 0.18.2
ClosedPublic

Authored by sethfl on Jul 13 2021, 11:55 AM.

Details

Summary

Changelog:

  • Features
    • Ignore known backup/template filename suffixes when selecting the syntax
  • Other
    • Add bash completion
    • Fix Clippy lints
    • Add syntax highlighting test files
  • Syntaxes
    • Upgraded Julia syntax to fix a highlighting bug
    • Added support for dash and XAML
    • Apply DotENV syntax for for .env.default and .env.defaults files
Test Plan
  • View some files

Diff Detail

Repository
R4509 bat
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1081
Build 1081: arc lint + arc unit

Event Timeline

sethfl created this revision.Jul 13 2021, 11:55 AM
sethfl requested review of this revision.Jul 13 2021, 11:55 AM
algent added a subscriber: algent.EditedJul 13 2021, 12:20 PM
  • Other
    • Add bash completion

I don't see any bash completion file. There are completions only for fish and zsh.

You can add it like this:
find ./ -name bat.bash -exec install -Dm00644 {} $installdir/usr/share/bash-completion/completions/bat \;
or :
install -Dm00644 assets/completions/bat.bash.in $installdir/usr/share/bash-completion/completions/bat

install -Dm00644 assets/completions/bat.bash.in $installdir/usr/share/bash-completion/completions/bat

Don't do that. That file is a template file (see its extension .in). I'm in favor of removing all the find calls, but targeting the right files.

algent added a comment.EditedJul 13 2021, 2:52 PM

@livingsilver94 is right. Just compiled and the target files for completions are in:
target/debug/build/bat-e80b9fedac527dea/out/assets/completions/
target/release/build/bat-e80b9fedac527dea/out/assets/completions/
The manual is in:
target/debug/build/bat-e80b9fedac527dea/out/assets/manual/
target/release/build/bat-e80b9fedac527dea/out/assets/manual/
Files in both locations are identical. So I think using find command is fine.

sethfl updated this revision to Diff 27718.Jul 14 2021, 1:12 AM

actually add the bash completions (oops)

sethfl added inline comments.Jul 14 2021, 1:15 AM
package.yml
27

I think I found a good compromise between @livingsilver94 and @algent's suggestions (plus the absolute path to the files won't have to be updated for every new version).

To avoid using find, you probably can run install against e.g. target/release/build/*/out/assets/manual/. I'm pretty sure it is guaranteed that only one dir will be inside build.

JoshStrobl requested changes to this revision.Jul 16 2021, 10:15 AM
JoshStrobl added a subscriber: JoshStrobl.

Yea globbing should work. Alternatively just interpolate ${version} into the path.

This revision now requires changes to proceed.Jul 16 2021, 10:15 AM
sethfl updated this revision to Diff 27754.Jul 17 2021, 12:50 AM

replace find with file globbing

sethfl added inline comments.Jul 17 2021, 12:52 AM
package.yml
24

Interpolating ${version} doesn't work here as the build folder for bat is not named after the version number (ex: bat-e80b9fedac527dea instead of bat-0.18.2)

JoshStrobl accepted this revision.Jul 21 2021, 12:20 PM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 21 2021, 12:20 PM
This revision was automatically updated to reflect the committed changes.