chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / jq / install.sh
1 #!/bin/bash
2 set -e
3 set -u
4
5 function __init_jq() {
6
7     ##############
8     # Install jq #
9     ##############
10
11     WEBI_SINGLE=true
12
13     pkg_get_current_version() {
14         # 'jq --version' has output in this format:
15         #       jq-1.6
16         # This trims it down to just the version number:
17         #       1.6
18         echo $(jq --version 2> /dev/null | head -n 1 | sed 's:^jq-::')
19     }
20 }
21
22 __init_jq