chore(style): convert blocks into functions (see #325)
[webi-installers/.git] / prettier / install.sh
index 7df196f687cff355053b8c08012e7e55461f51e0..cf26aae440ef816fc26fbae78e8ad1612494cadf 100644 (file)
@@ -1,7 +1,11 @@
 #!/bin/bash
 
-if [ -z "$(npm --version 2> /dev/null)" ]; then
-    webi node
-    export PATH="$HOME/.local/opt/node/bin:$PATH"
-fi
-npm install -g prettier@latest
+function __init_prettier() {
+    if [ -z "$(npm --version 2> /dev/null)" ]; then
+        webi node
+        export PATH="$HOME/.local/opt/node/bin:$PATH"
+    fi
+    npm install -g prettier@latest
+}
+
+__init_prettier