-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbootstrap.sh
44 lines (40 loc) · 971 Bytes
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
PROJECTS_REPO="https://github.com/bcrumbs/booben-projects.git"
for i in "$@"
do
case $i in
-d=*|--project-dir=*)
PROJECTS_DIR="${i#*=}"
;;
-p=*|--project-name=*)
PROJECT_NAME="${i#*=}"
;;
--deploy=*)
DEPLOY="${i#*=}"
;;
*)
;;
esac
done
if [ -z "${PROJECTS_DIR}" ]; then
PROJECTS_DIR="booben-projects"
fi
if [ -z "${PROJECT_NAME}" ]; then
PROJECT_NAME="*"
fi
git clone ${PROJECTS_REPO} ${PROJECTS_DIR}
if [ "${PROJECTS_DIR:0:1}" = "/" ]; then
echo "{\"projectsDir\":\"${PROJECTS_DIR}\"}" > projects-config.json
else
echo "{\"projectsDir\":\"${PWD}/${PROJECTS_DIR}\"}" > projects-config.json
fi
npm i
if [ -z "${DEPLOY}" ]; then
npm run build
else
npm run build:demo
fi
while read PROJECT; do
echo "BUILD PROJECT: ${PROJECT}"
node rebuild-components-bundle.js --config projects-config.json -- ${PROJECT}
done < <(find ${PROJECTS_DIR}/${PROJECT_NAME} -maxdepth 0 -type d | sed 's/.*\///g')