chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / _example / install.sh
index 280997cd7af9a93c1e61a8f4ff4a1fb7c63d79df..cebf7a415cca647e8a4d8a964e6acf37c6d6c7d4 100644 (file)
@@ -27,13 +27,15 @@ function __init_foobar() {
         mv ./foobar-*/foo "$pkg_src_cmd"
     }
 
-    # pkg_get_current_version is recommended, but (soon) not required
+    # pkg_get_current_version is recommended, but not required
     pkg_get_current_version() {
         # 'foo --version' has output in this format:
         #       foobar 0.99.9 (rev abcdef0123)
         # This trims it down to just the version number:
         #       0.99.9
-        echo $(foo --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+        foo --version 2> /dev/null |
+            head -n 1 |
+            cut -d ' ' -f 2
     }
 
 }