forked from pryv/app-web-auth3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
47 lines (39 loc) · 965 Bytes
/
setup.sh
File metadata and controls
47 lines (39 loc) · 965 Bytes
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
#!/bin/sh
set -e
# working dir fix
scriptsFolder=$(cd $(dirname "$0"); pwd)
cd "$scriptsFolder/.."
echo "
Installing Node modules...
"
npm install
# Set up pre-commit lint hook
if [ ! -f .git/hooks/pre-commit ]; then
echo "Setting up pre-commit lint hook..."
mkdir -p .git/hooks
cat > .git/hooks/pre-commit << 'HOOK'
#!/bin/sh
npm run lint
HOOK
chmod +x .git/hooks/pre-commit
fi
if [ -d dist ] && [ ! -d dist/.git ]; then
echo "
Conflict with previous unpublished build, cleaning 'dist' folder."
rm -rf dist/
fi
if [ ! -d dist ]; then
echo "
Setting up 'dist' folder for publishing to GitHub pages...
"
git clone -b gh-pages git@github.com:healthdatasafe/app-web-auth3-hds.git dist
fi
if [ ! -d distprod ]; then
echo "
Setting up 'distprod' folder for publishing to production...
"
git clone git@github.com:healthdatasafe/app-web-auth3-hds-prod.git distprod
fi
echo "
Setup is complete, you can proceed with building and publishing.
"