This commit is contained in:
AJ ONeal
2020-07-05 01:12:07 +00:00
parent 1fe9a457c8
commit da8e2a5864
3 changed files with 90 additions and 0 deletions

39
bat/README.md Normal file
View File

@@ -0,0 +1,39 @@
---
title: bat
homepage: https://github.com/sharkdp/bat
tagline: |
bat: A cat(1) clone with syntax highlighting and Git integration.
description: |
`bat` is pretty much what `cat` would be if it were developed today in the world of Markdown, git, etc.
---
## How to alias as `cat`
Update your `.bashrc`, `.zshrc`, or `.profile`
```bash
alias cat="bat --style=plain"
```
## How to change the default behavior
Take a look at the config options:
```bash
bat --help
```
Check to see where your config file is:
```bash
echo 'N' | bat --generate-config-file
```
Edit the config file:
`~/.config/bat/config`:
```txt
# no numbers or headers, just highlighting and such
--style="plain"
```

31
bat/install.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
{
set -e
set -u
###############
# Install bat #
###############
WEBI_SINGLE=true
pkg_get_current_version() {
# 'bat --version' has output in this format:
# bat 0.15.4
# This trims it down to just the version number:
# 0.15.4
echo $(bat --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
# $HOME/.local/xbin
mkdir -p "$pkg_src_bin"
# mv ./bat-*/bat "$HOME/.local/xbin/bat-v0.15.4"
mv ./bat-*/bat "$pkg_src_cmd"
# chmod a+x "$HOME/.local/xbin/rg-v11.1.0"
chmod a+x "$pkg_src_cmd"
}
}

20
bat/releases.js Normal file
View File

@@ -0,0 +1,20 @@
'use strict';
var github = require('../_common/github.js');
var owner = 'sharkdp';
var repo = 'bat';
module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
return all;
});
};
if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
all = require('../_webi/normalize.js')(all);
all.releases = all.releases.slice(0, 10);
//console.info(JSON.stringify(all));
console.info(JSON.stringify(all, null, 2));
});
}