forked from espruino/EspruinoDocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·51 lines (43 loc) · 1.64 KB
/
build.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
#!/bin/bash
# Copyright (c) 2013 Gordon Williams, Pur3 Ltd. See the file LICENSE for copying permission.
cd `dirname $0`
BUILDARGS=$1
DIR=`pwd`
WEBSITE=~/workspace/espruinowebsite
mkdir -p $WEBSITE $WEBSITE/www/img $WEBSITE/www/scripts
mkdir -p html/refimages
mkdir -p html/boards
mkdir -p html/img
rm -f html/*.html
rm -f html/*.js
rm -f html/refimages/*
rm -f html/boards/*
node bin/commenter.js
cd ../Espruino
for BOARDNAME in PICO_R1_3 ESPRUINOBOARD ESP8266_BOARD EMW3165 MICROBIT2 ESPRUINOWIFI PUCKJS PIXLJS ESP32 WIO_LTE MDBT42Q THINGY52 NRF52832DK STM32L496GDISCOVERY RAK8211 RAK8212 RAK5010
do
python scripts/build_board_docs.py $BOARDNAME pinout
mv boards/$BOARDNAME.html $DIR/html/boards
cp boards/img/$BOARDNAME.* $WEBSITE/www/img
cp boards/img/$BOARDNAME.* $DIR/html/img
done
cd $DIR
echo "Getting file modification times..."
git ls-tree -r --name-only HEAD | xargs -I{} git log -1 --format="%at {}" -- {} | sort > ordering.txt
# Push these items to the front
echo "2000000000 tutorials/Bangle.js Getting Started.md" >> ordering.txt
echo "2000000000 tutorials/Bangle.js Development.md" >> ordering.txt
# Built reference docs and references.json
node --trace-deprecation bin/build.js $BUILDARGS || exit 1
#rm $WEBSITE/reference/*
cp html/*.html $WEBSITE/reference/
cp html/keywords.js $WEBSITE/www/js
cp datasheets/* $WEBSITE/www/datasheets
cp files/* $WEBSITE/www/files
mkdir -p $WEBSITE/www/refimages
rm $WEBSITE/www/refimages/*
cp html/refimages/* $WEBSITE/www/refimages
# Resize any images that might be too big, and remove metadata
#mogrify -resize "600x800>" -strip $WEBSITE/www/refimages/*
# -----------------------------------
bash buildmodules.sh