Repository navigation
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·90 lines (71 loc) · 3.05 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·90 lines (71 loc) · 3.05 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
source build-config.cfg
echo "Updating theme files"
rm -rf $destination
mkdir $destination
##Removendo o arquivo sass
##rm -rf $destination/scss
## Install npm dependencies and copy Bootstrap files
npm install
## Compile SASS
sh compile-sass.sh
## Ensure Bootstrap CSS is compiled
if [ ! -f "src/assets/vendor/bootstrap/scss/bootstrap.min.css" ]; then
echo "Warning: Bootstrap CSS not found. Recompiling..."
cd src/assets/scss
npx sass -s compressed bootstrap_custom.scss:../vendor/bootstrap/scss/bootstrap.min.css
cd ../../..
fi
cp -R src/* $destination/
##Bootstrap
# Bootstrap files are now handled in the cleanup section below
## Clean up source files not needed in final theme
echo "Cleaning up source files..."
# Remove SCSS source files (only compiled CSS should remain)
rm -rf $destination/assets/scss/
# Clean up Bootstrap vendor files - keep only what's needed
if [ -d "$destination/assets/vendor/bootstrap" ]; then
echo "Cleaning up Bootstrap vendor files..."
# Keep only the essential JS and compiled CSS
mkdir -p $destination/assets/vendor/bootstrap/js
# Remove source files but preserve the compiled bootstrap.min.css
find $destination/assets/vendor/bootstrap/scss -name "*.scss" -delete
rm -rf $destination/assets/vendor/bootstrap/js/src/
rm -rf $destination/assets/vendor/bootstrap/js/dist/
# Remove other unnecessary Bootstrap files
find $destination/assets/vendor/bootstrap -name "*.scss" -delete
find $destination/assets/vendor/bootstrap -name "*.js" ! -name "bootstrap.min.js" -delete
find $destination/assets/vendor/bootstrap -name "*.map" -delete
find $destination/assets/vendor/bootstrap -name "*.md" -delete
find $destination/assets/vendor/bootstrap -name "*.txt" -delete
find $destination/assets/vendor/bootstrap -name "*.yml" -delete
find $destination/assets/vendor/bootstrap -name "*.json" -delete
find $destination/assets/vendor/bootstrap -name "*.xml" -delete
find $destination/assets/vendor/bootstrap -name "*.html" -delete
# Remove empty directories
find $destination/assets/vendor/bootstrap -type d -empty -delete 2>/dev/null || true
fi
# Remove source maps (not needed in production)
find $destination -name "*.css.map" -delete
find $destination -name "*.js.map" -delete
# Remove development-only files
rm -rf $destination/vendor/
rm -rf $destination/node_modules/
rm -rf $destination/.git/
rm -rf $destination/.gitignore
rm -rf $destination/README.md
rm -rf $destination/package.json
rm -rf $destination/package-lock.json
rm -rf $destination/build.sh
rm -rf $destination/build-watch.sh
rm -rf $destination/compile-sass.sh
rm -rf $destination/install.sh
rm -rf $destination/build-config.cfg
rm -rf $destination/build-config-sample.cfg
rm -rf $destination/theme-unit-test/
# Remove any other development artifacts
find $destination -name ".DS_Store" -delete 2>/dev/null || true
find $destination -name "Thumbs.db" -delete 2>/dev/null || true
find $destination -name "*.log" -delete 2>/dev/null || true
echo "Cleanup completed!"
echo "Compilation finished!"