chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / watchexec / install.sh
index b4b92d34caedf3108a5d3b9c60bcc9896133fd56..f457f0f16aa3d8c488aa8f40171ca51950d43f56 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/bash
+set -e
+set -u
 
-{
-    set -e
-    set -u
+function __init_watchexec() {
 
     #####################
     # Install watchexec #
     # pkg_get_current_version is recommended, but (soon) not required
     pkg_get_current_version() {
         # 'watchexec --version' has output in this format:
-        #       watchexec 0.99.9 (rev abcdef0123)
+        #       watchexec 0.99.9
         # This trims it down to just the version number:
         #       0.99.9
-        echo $(watchexec --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+        echo $(watchexec --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
     }
 
 }
+
+__init_watchexec