This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
forked from themeum/kirki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
70 lines (50 loc) · 1.83 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
echo ""
echo "******************************************"
echo "** Building the WP plugin version... **"
echo ""
shopt -s extglob
shopt -s dotglob
if [ -d "kirki" ]; then
rm -rf kirki
fi
mkdir kirki
echo "Copying files (be patient :) ...";
cp -r !(.|..|.git|.github|kirki|node_modules|.editorconfig|.gitignore|.gitattributes|.phpcs.xml.dist|build.sh|CHANGELOG.md|CODE_OF_CONDUCT.md|example.php|package.json|package-lock.json|README.md) kirki/
cd ..
if [ -d "kirki" ]; then
rm -rf kirki
fi
mkdir kirki
mv kirki-git/kirki/* kirki/
rm -rf kirki-git/kirki/
cd kirki
echo "Updating composer to remove dev dependencies ...";
sed -i '/composer\/installers/d' composer.json
sed -i '/dealerdirect\/phpcodesniffer-composer-installer/d' composer.json
sed -i '/wp-coding-standards\/wpcs/d' composer.json
sed -i '/phpcompatibility\/phpcompatibility-wp/d' composer.json
sed -i '/wptrt\/wpthemereview/d' composer.json
composer update
echo "Removing un-necessary files inside individual packages ..."
rm -rf packages/kirki-framework/**/.github
rm -rf packages/kirki-framework/**/.gitignore
rm -rf packages/kirki-framework/**/src/*.scss
rm -rf packages/kirki-framework/**/src/scss/*.scss
rm -rf packages/kirki-framework/**/.prettierrc.js
rm -rf packages/kirki-framework/**/.prettierignore
rm -rf packages/kirki-framework/**/.babelrc
rm -rf packages/kirki-framework/**/webpack.config.js
rm -rf packages/kirki-framework/**/package.json
rm -rf packages/kirki-framework/**/Gruntfile.js
rm -rf packages/kirki-framework/**/README.md
cd ../kirki-git
shopt -u extglob
shopt -u dotglob
echo ""
echo "** All done. **"
echo "** WP plugin version is ready **"
echo "** You can check the result in ../kirki **"
echo "** **"
echo "****************** DONE ******************"
echo ""