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