forked from june07/nodebb-plugin-lightgallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·30 lines (28 loc) · 1.01 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
#!/bin/bash
rm -fR dist
function build {
package=$1
cd node_modules/$package
echo `pwd`
sed -i "s/'default'\:\s\['\$'\]/default: ['jQuery']/" Gruntfile.js
npm install
if [[ $package == "lightgallery" ]]; then
sed -i "s/'connect', 'qunit', 'umd:all'/'connect', 'umd:all'/" Gruntfile.js
fi
grunt --force
if [[ $package == "lightgallery" ]]; then
mv dist ../../
mkdir ../../dist/plugins
else
cp dist/${package}.min.js ../../dist/plugins/
fi
cd ../..
echo `pwd`
}
sed -i "s/\$lg-path-fonts:\s'.*'/\$lg-path-fonts: '\.\.\/plugins\/nodebb-plugin-lightgallery\/fonts\/'/" ./node_modules/lightgallery/src/sass/lg-variables.scss
sed -i "s/\$lg-path-images:\s'.*'/\$lg-path-images: '\.\.\/plugins\/nodebb-plugin-lightgallery\/images\/'/" ./node_modules/lightgallery/src/sass/lg-variables.scss
build lightgallery
plugins='jquery lg-thumbnail lg-autoplay lg-video lg-fullscreen lg-pager lg-zoom lg-hash lg-share'
for plugin in $plugins; do
build $plugin
done