chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / fzf / install.sh
index 908001c63d6eadd43ed2042675cf234cd28e5aaf..eb865770d15a16691fe1e7490392b2c3ee5bbe92 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/bash
+set -e
+set -u
 
-{
-    set -e
-    set -u
+function __init_fzf() {
 
     ###############
     # Install fzf #
     WEBI_SINGLE=true
 
     pkg_get_current_version() {
-      # 'fzf --version' has output in this format:
-      #       0.21.1 (334a4fa)
-      # This trims it down to just the version number:
-      #       0.21.1
-      echo $(fzf --version 2>/dev/null | head -n 1 | cut -d' ' -f 1)
+        # 'fzf --version' has output in this format:
+        #       0.21.1 (334a4fa)
+        # This trims it down to just the version number:
+        #       0.21.1
+        echo $(fzf --version 2> /dev/null | head -n 1 | cut -d' ' -f 1)
     }
 
     pkg_install() {
@@ -29,3 +29,5 @@
         chmod a+x "$pkg_src_cmd"
     }
 }
+
+__init_fzf