chore: make Prettier
[webi-installers/.git] / node / install.sh
index 4dd6655bb0f60e041133c1eb04c0f39342237b15..f321ab568d78e2f0cfba65ef20a18a1194b85ef7 100644 (file)
@@ -4,7 +4,7 @@
 # There is no magic!
 # The custom functions for node are here.
 # The generic functions - version checks, download, extract, etc - are here:
-#   - https://github.com/webinstall/packages/branches/master/webi/template.bash
+#   - https://github.com/webinstall/packages/branches/master/_webi/template.sh
 
 set -e
 set -u
@@ -12,15 +12,18 @@ set -u
 pkg_cmd_name="node"
 #WEBI_SINGLE=""
 
-pkg_get_current_version() {
+function pkg_get_current_version() {
     # 'node --version' has output in this format:
     #       v12.8.0
     # This trims it down to just the version number:
     #       12.8.0
-    echo "$(node --version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
+    node --version 2> /dev/null |
+        head -n 1 |
+        cut -d' ' -f1 |
+        sed 's:^v::'
 }
 
-pkg_install() {
+function pkg_install() {
     # mkdir -p $HOME/.local/opt
     mkdir -p "$(dirname $pkg_src)"
 
@@ -28,7 +31,7 @@ pkg_install() {
     mv ./"$pkg_cmd_name"* "$pkg_src"
 }
 
-pkg_link() {
+function pkg_link() {
     # rm -f "$HOME/.local/opt/node"
     rm -f "$pkg_dst"
 
@@ -39,6 +42,6 @@ pkg_link() {
     "$pkg_src"/bin/node "$pkg_src"/bin/npm config set scripts-prepend-node-path=true
 }
 
-pkg_done_message() {
+function pkg_done_message() {
     echo "Installed 'node' and 'npm' at $pkg_dst"
 }