-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_binary.sh
More file actions
executable file
·67 lines (57 loc) · 1.76 KB
/
build_binary.sh
File metadata and controls
executable file
·67 lines (57 loc) · 1.76 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
#!/bin/bash
# Build Standalone Binary for Smart Commit
# This script creates a single executable file that doesn't require Python installation
set -e
echo "🔨 Building Smart Commit Standalone Binary"
echo "=========================================="
echo ""
# Check if PyInstaller is installed
if ! command -v pyinstaller &> /dev/null; then
echo "❌ PyInstaller not found. Installing..."
pip install pyinstaller
fi
echo "✅ PyInstaller found"
# Create build directory
mkdir -p dist
echo "📦 Building standalone binary..."
# Build the binary
pyinstaller \
--onefile \
--name smart-commit \
--add-data "smart_commit/config.yml:smart_commit" \
--hidden-import google.generativeai \
--hidden-import pydantic \
--hidden-import yaml \
--hidden-import click \
--hidden-import dotenv \
smart_commit/main.py
if [ $? -eq 0 ]; then
echo ""
echo "✅ Binary built successfully!"
echo ""
echo "📁 Output location: dist/smart-commit"
echo ""
echo "📊 File size:"
ls -lh dist/smart-commit
echo ""
echo "🧪 Testing the binary..."
# Test the binary
if [ -f "dist/smart-commit" ]; then
echo "✅ Binary file created successfully!"
echo ""
echo "🎉 Your standalone binary is ready!"
echo ""
echo "📋 How to use:"
echo "1. Copy dist/smart-commit to any directory"
echo "2. Make it executable: chmod +x smart-commit"
echo "3. Run: ./smart-commit --help"
echo ""
echo "💡 The binary contains everything needed - no Python installation required!"
else
echo "❌ Binary file not found. Check the build output above."
exit 1
fi
else
echo "❌ Build failed. Check the error messages above."
exit 1
fi