-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·91 lines (81 loc) · 2.39 KB
/
install.sh
File metadata and controls
executable file
·91 lines (81 loc) · 2.39 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
91
#!/bin/bash
set -e
echo "📺 Installing tvcode - Apple TV Video Transcoder"
echo "================================================"
echo ""
# Check if Rust is installed
if ! command -v cargo &> /dev/null; then
echo "❌ Error: Rust is not installed"
echo " Install from: https://rustup.rs/"
exit 1
fi
# Check if ffmpeg is installed
if ! command -v ffmpeg &> /dev/null || ! command -v ffprobe &> /dev/null; then
echo "⚠️ Warning: ffmpeg not found"
echo " Install with: brew install ffmpeg (macOS)"
echo ""
fi
# Build the project
echo "🔨 Building tvcode..."
cargo build --release
if [ $? -ne 0 ]; then
echo "❌ Build failed"
exit 1
fi
echo "✅ Build successful"
echo ""
# Install options
echo "Choose installation method:"
echo " 1) Install to /usr/local/bin (recommended, requires sudo)"
echo " 2) Add to PATH in ~/.zshrc"
echo " 3) Add to PATH in ~/.bashrc"
echo " 4) Skip installation (use from target/release/tvcode)"
echo ""
read -p "Enter choice [1-4]: " choice
case $choice in
1)
echo ""
echo "Installing to /usr/local/bin..."
sudo cp target/release/tvcode /usr/local/bin/
echo "✅ Installed to /usr/local/bin/tvcode"
echo ""
echo "You can now run: tvcode"
;;
2)
echo ""
INSTALL_PATH="/Volumes/Phobos/projects/home_video_loader/target/release"
if ! grep -q "$INSTALL_PATH" ~/.zshrc 2>/dev/null; then
echo "export PATH=\"$INSTALL_PATH:\$PATH\"" >> ~/.zshrc
echo "✅ Added to ~/.zshrc"
echo ""
echo "Run: source ~/.zshrc"
echo "Then: tvcode"
else
echo "✅ Already in ~/.zshrc"
fi
;;
3)
echo ""
INSTALL_PATH="/Volumes/Phobos/projects/home_video_loader/target/release"
if ! grep -q "$INSTALL_PATH" ~/.bashrc 2>/dev/null; then
echo "export PATH=\"$INSTALL_PATH:\$PATH\"" >> ~/.bashrc
echo "✅ Added to ~/.bashrc"
echo ""
echo "Run: source ~/.bashrc"
echo "Then: tvcode"
else
echo "✅ Already in ~/.bashrc"
fi
;;
4)
echo ""
echo "✅ Binary available at: target/release/tvcode"
echo " Run with: ./target/release/tvcode"
;;
*)
echo "Invalid choice"
exit 1
;;
esac
echo ""
echo "🎉 Installation complete!"