forked from OriginProtocol/dshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildThemes.sh
executable file
·35 lines (29 loc) · 893 Bytes
/
buildThemes.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
#!/bin/sh
set -e
buildTheme () {
themeName=$(basename $1)
if [ $themeName = "shared" ]; then
return
fi
echo "Building $themeName..."
export NODE_ENV=production
export THEME=$themeName
./node_modules/.bin/webpack --output-path="../backend/themes/$themeName"
cp "$1/screenshot.png" "../backend/themes/$themeName/screenshot.png"
cp "$1/theme.json" "../backend/themes/$themeName/theme.json"
if [ -d "../backend/themes/$themeName/dist" ]; then
cp "../node_modules/openpgp/dist/openpgp.min.js" "../node_modules/openpgp/dist/openpgp.worker.min.js" "../backend/themes/$themeName/dist"
fi
echo $themeName built
}
if [ -z "$1" ]; then
rm -rf ../backend/themes
mkdir -p ../backend/themes
for themeDir in `find . -path './src/themes/*' -prune -type d`
do
buildTheme "$themeDir"
done
else
rm -rf "../backend/themes/$1"
buildTheme "src/themes/$1"
fi