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