@@ -14,13 +14,30 @@ if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1414 exit 1
1515fi
1616
17+ # Find repo root (directory containing .git)
18+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
19+ REPO_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
20+
21+ # Verify we found the repo root
22+ if [ ! -d " $REPO_ROOT /.git" ]; then
23+ echo " Error: Could not find repository root (no .git directory)"
24+ exit 1
25+ fi
26+
27+ if [ ! -d " $REPO_ROOT /sensors/blackbox" ]; then
28+ echo " Error: Could not find sensors/blackbox directory"
29+ exit 1
30+ fi
31+
1732echo " ======================================"
1833echo " Building Blackbox Release $VERSION "
1934echo " ======================================"
2035echo " "
36+ echo " Repository: $REPO_ROOT "
37+ echo " "
2138
2239# Navigate to firmware directory
23- cd sensors/blackbox
40+ cd " $REPO_ROOT / sensors/blackbox"
2441
2542# Build optimized firmware
2643echo " 📦 Building optimized firmware..."
@@ -47,7 +64,7 @@ if [ $? -ne 0 ]; then
4764 exit 1
4865fi
4966
50- echo " ✅ Binary created: sensors/blackbox/blackbox-${VERSION} .bin"
67+ echo " ✅ Binary created: $REPO_ROOT / sensors/blackbox/blackbox-${VERSION} .bin"
5168echo " "
5269
5370# Get binary size
@@ -59,11 +76,11 @@ echo "======================================"
5976echo " Release build complete!"
6077echo " ======================================"
6178echo " "
62- echo " Binary location: sensors/blackbox/blackbox-${VERSION} .bin"
79+ echo " Binary location: $REPO_ROOT / sensors/blackbox/blackbox-${VERSION} .bin"
6380echo " "
6481echo " Next steps:"
6582echo " 1. Test the binary:"
66- echo " espflash write-bin 0x0 sensors/blackbox/blackbox-${VERSION} .bin"
83+ echo " espflash write-bin 0x0 $REPO_ROOT / sensors/blackbox/blackbox-${VERSION} .bin"
6784echo " "
6885echo " 2. Commit any remaining changes:"
6986echo " git add ."
@@ -79,6 +96,7 @@ echo " git tag -a ${VERSION} -m 'Release ${VERSION} - Access Point Mode + Mobi
7996echo " git push origin ${VERSION} "
8097echo " "
8198echo " 5. Create GitHub release with binary:"
99+ echo " cd $REPO_ROOT "
82100echo " gh release create ${VERSION} \\ "
83101echo " --title '${VERSION} - Access Point Mode + Mobile Dashboard' \\ "
84102echo " --notes-file release-notes.md \\ "
0 commit comments