aboutsummaryrefslogtreecommitdiffstats
path: root/config/build.sh
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-19 22:46:57 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-19 22:46:57 +0100
commit3038cdeb6287720a42b905fc9cc09eda658f12cf (patch)
tree06f9ddff916ee5b6207d05f6135e82baf3157f37 /config/build.sh
parentca734febb23133e2b405cdc69e58d9cf6011298f (diff)
feat: add vue small apps
Diffstat (limited to 'config/build.sh')
-rwxr-xr-xconfig/build.sh39
1 files changed, 36 insertions, 3 deletions
diff --git a/config/build.sh b/config/build.sh
index 60f4ccb..9bf8230 100755
--- a/config/build.sh
+++ b/config/build.sh
@@ -1,13 +1,14 @@
#!/usr/bin/env bash
#
# Build
-# Build all Angular & React projects.
+# Build all Angular, React & Vue projects.
###############################################################################
# 1.0. Config
###############################################################################
_ANGULAR_PROJECTS="projects/angular-small-apps"
_REACT_PROJECTS="projects/react-small-apps"
+_VUE_PROJECTS="projects/vue-small-apps"
###############################################################################
# 2.0. Helpers
@@ -115,7 +116,38 @@ setup_react_projects() {
}
###############################################################################
-# 5.0. Main
+# 5.0. Vue
+###############################################################################
+
+install_vue_dependencies() {
+ if [ ! -d "./public/${_VUE_PROJECTS}" ]; then
+ error "Vue projects are missing."
+ printf "Exit.\n"
+ exit 1
+ fi
+
+ cd "./public/${_VUE_PROJECTS}" || exit
+ yarn
+ cd "$OLDPWD" || exit
+}
+
+build_vue_app() {
+ [ $# -ne 1 ] && error_unexpected
+
+ cd "./public/${_VUE_PROJECTS}" || exit
+ PUBLIC_URL="/${_VUE_PROJECTS}/apps/${1}/dist/" yarn --cwd "apps/${1}" run build
+ info "${1} built."
+ cd "$OLDPWD" || exit
+}
+
+setup_vue_projects() {
+ install_vue_dependencies
+ build_vue_app "typing"
+ success "Vue apps are ready."
+}
+
+###############################################################################
+# 6.0. Main
###############################################################################
# Check if Yarn is installed.
@@ -130,11 +162,12 @@ is_yarn_installed() {
fi
}
-# Build Angular & React projects.
+# Build Angular, React & Vue projects.
build_all_projects() {
is_yarn_installed
setup_angular_projects
setup_react_projects
+ setup_vue_projects
success "All projects have been built."
}