forked from platformsh/platformsh-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_local.sh
executable file
·52 lines (40 loc) · 871 Bytes
/
build_local.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
48
49
50
51
52
#!/usr/bin/env bash
clean_dir () {
DIRECTORY=$1
if [ -d "$DIRECTORY" ]; then
echo "$DIRECTORY exists. Removing..."
rm -rf $DIRECTORY
echo "Done."
else
echo "$DIRECTORY does not exist. All is well."
fi
}
clean_file () {
FILE=$1
if [ -f "$FILE" ]; then
echo "$FILE exists. Removing..."
rm $FILE
echo "Done."
else
echo "$FILE does not exist. All is well."
fi
}
BUILD_DIR=$1
cd sites/$BUILD_DIR
clean_file postcss.config.js
clean_dir fetchedFilesCache
clean_dir node_modules
clean_dir public
clean_dir resources
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
npm run build:search
hugo
npm run build:assets
clear
printf "
BUILD COMPLETE
Verify the resulting build by running the command
python3 -m http.server 8888 -d sites/$BUILD_DIR/public
"