add bat
[webi-installers/.git] / bat / install.sh
1 #!/bin/bash
2
3 {
4     set -e
5     set -u
6
7     ###############
8     # Install bat #
9     ###############
10
11     WEBI_SINGLE=true
12
13     pkg_get_current_version() {
14       # 'bat --version' has output in this format:
15       #       bat 0.15.4
16       # This trims it down to just the version number:
17       #       0.15.4
18       echo $(bat --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
19     }
20
21     pkg_install() {
22         # $HOME/.local/xbin
23         mkdir -p "$pkg_src_bin"
24
25         # mv ./bat-*/bat "$HOME/.local/xbin/bat-v0.15.4"
26         mv ./bat-*/bat "$pkg_src_cmd"
27
28         # chmod a+x "$HOME/.local/xbin/rg-v11.1.0"
29         chmod a+x "$pkg_src_cmd"
30     }
31 }