-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·64 lines (55 loc) · 1.93 KB
/
install.sh
File metadata and controls
executable file
·64 lines (55 loc) · 1.93 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
#!/bin/bash
# CodeSnippetBank Installation Script
echo "🚀 Installing CodeSnippetBank CLI..."
echo "=================================="
# Check Python version
python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
required_version="3.6"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "❌ Error: Python $required_version or higher is required (found $python_version)"
exit 1
fi
echo "✅ Python $python_version detected"
# Create virtual environment (optional)
read -p "Create virtual environment? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Creating virtual environment..."
python3 -m venv venv
source venv/bin/activate
fi
# Install package
echo "📦 Installing CodeSnippetBank..."
pip install -e .
# Create config directory
mkdir -p ~/.codebank
echo "✅ Created config directory: ~/.codebank"
# Download sample tissues (optional)
read -p "Download sample tissue pack? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "📥 Downloading sample tissues..."
mkdir -p ~/.codebank/tissues
# In real implementation, would download from CDN
cp -r tissues/* ~/.codebank/tissues/
echo "✅ Sample tissues installed"
fi
# Test installation
echo -e "\n🧪 Testing installation..."
tissue --help > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "✅ Installation successful!"
echo ""
echo "🎉 CodeSnippetBank CLI is ready to use!"
echo ""
echo "Quick start:"
echo " tissue search 'edge detection' # Search for tissues"
echo " tissue info CV-TISSUE-001 # Show tissue details"
echo " tissue test CV-TISSUE-001 # Test a tissue"
echo " tissue pack CV-001 --device esp32 # Create deployment pack"
echo ""
echo "For more help: tissue --help"
else
echo "❌ Installation failed. Please check the error messages above."
exit 1
fi