File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ module . exports = {
2+ plugins : [
3+ require ( 'cssnano' ) ( {
4+ preset : 'default'
5+ } )
6+ ]
7+ } ;
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # first argument is *.zip file name
5+ fileName=" theme.zip"
6+
7+ # 1. change fileName if arg passed
8+ if [ $# -ne 0 ]; then
9+ fileName=$1
10+ fi
11+
12+ # 2. delete zip if exists
13+ if [ -f " public/content/$fileName " ]; then
14+ rm public/content/$fileName
15+ fi
16+
17+ # 3. zip current theme
18+ cd theme
19+ zip -rq9 ../public/content/$fileName . -x node_modules\* dist\* assets/index.html assets/js/bundle-\* assets/css/bundle-\*
20+
21+ # 4. show success message
22+ echo success
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # first argument is *.zip file name
5+ fileName=$1
6+
7+ if [ $# -eq 0 ]; then
8+ echo " No arguments supplied"
9+ exit 1
10+ fi
11+
12+ # 1. check file exists
13+ if [ ! -f " public/content/$fileName " ]; then
14+ echo " File not found!"
15+ exit 1
16+ fi
17+
18+ # 3. remove all the contents of theme folder
19+ rm -rf theme/*
20+
21+ # 4. unzip to current theme
22+ unzip -q " public/content/$fileName " -d " theme"
23+
24+ # 5. build theme
25+ npm run theme:build
26+
27+ # 6. show success message
28+ echo -e ' \e[1;92m' Theme $fileName successfully installed' \e[0m'
You can’t perform that action at this time.
0 commit comments