forked from oscc-web/ieda-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·47 lines (42 loc) · 1.04 KB
/
setup.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
45
46
47
#!/usr/bin/env bash
set -e
PATH_ROOT=${PWD}
PATH_COMM=${PATH_ROOT}/common/
PATH_RESS=${PATH_ROOT}/src/.vuepress/public/res/
PATH_NODE=${PATH_ROOT}/node_modules/
PRJ_NAME=${PATH_ROOT##*/}
if [ ! -d ${PATH_COMM} ]; then
echo "Downloading common scripts..."
rm -rf ${PATH_COMM}
git clone [email protected]:oscc-web/oscc-common.git ${PATH_COMM}
else
echo "Updating common scripts..."
cd ${PATH_COMM}
git pull origin main
cd ${PATH_ROOT}
fi
if [ ! -d ${PATH_RESS}/.git ]; then
echo ""
echo "Downloading resources..."
rm -rf ${PATH_RESS}
git clone [email protected]:oscc-web/${PRJ_NAME}-resources.git ${PATH_RESS}
else
echo ""
echo "Updating resources..."
cd ${PATH_RESS}
git pull origin main
cd ${PATH_ROOT}
fi
if [ ! -d ${PATH_NODE} ]; then
echo ""
echo "Downloading Node.js packages..."
npm install
else
echo ""
echo -n "Do you want to update Node.js packages? [Y/n]: "
read choice
if [ ${choice} == "Y" ]; then
npm install
fi
echo "Already up to date."
fi