chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / jq / install.sh
index 1bb6cf0cbef53c8c0b2799ff7f7cde1de7485232..0af4844a5af7f2a9865253aba5c74c50ac51b44e 100644 (file)
@@ -1,6 +1,8 @@
-{
-    set -e
-    set -u
+#!/bin/bash
+set -e
+set -u
+
+function __init_jq() {
 
     ##############
     # Install jq #
     WEBI_SINGLE=true
 
     pkg_get_current_version() {
-      # 'jq --version' has output in this format:
-      #       jq-1.6
-      # This trims it down to just the version number:
-      #       1.6
-      echo $(jq --version 2>/dev/null | head -n 1 | sed 's:^jq-::')
+        # 'jq --version' has output in this format:
+        #       jq-1.6
+        # This trims it down to just the version number:
+        #       1.6
+        echo $(jq --version 2> /dev/null | head -n 1 | sed 's:^jq-::')
     }
 }
+
+__init_jq