-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
Β·49 lines (37 loc) Β· 1.32 KB
/
build.sh
File metadata and controls
executable file
Β·49 lines (37 loc) Β· 1.32 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
#!/bin/bash
# Exit on error
set -e
echo "ποΈ Building Woke O Meter app..."
# Navigate to React app directory
cd wokeometer
# Install dependencies if needed
echo "π¦ Installing dependencies..."
npm install
# Build the React app
echo "π¨ Building the app..."
npm run build
# Check if build was successful
if [ ! -d "build" ]; then
echo "β Build failed! The build directory was not created."
exit 1
fi
# Navigate back to root
cd ..
# Remove old files from root (except for specific directories/files)
echo "π§Ή Cleaning up root directory..."
find . -maxdepth 1 -type f -not -name "README.md" -not -name "CNAME" -not -name "build.sh" -not -name ".gitignore" -not -name ".nojekyll" -delete
find . -maxdepth 1 -type d -not -path "./wokeometer" -not -path "." -not -path "./.git" -not -path "./.github" -exec rm -rf {} \;
# Copy build files to root (includes processed public files)
echo "π Copying build files to root..."
cp -r wokeometer/build/* .
# Verify that index.html exists in root
echo "π Verifying build files..."
if [ ! -f "index.html" ]; then
echo "β Build verification failed! index.html was not copied to root."
exit 1
else
echo "β Build files verified."
fi
# Create a .nojekyll file to disable GitHub Pages Jekyll processing
touch .nojekyll
echo "β
Build complete! Files are ready for GitHub Pages."