-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
路79 lines (67 loc) 路 2.08 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
路79 lines (67 loc) 路 2.08 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
#!/bin/sh
# 8bitify Install Script
# Colors for output (using tput for portability if available, otherwise fallback)
if command -v tput >/dev/null 2>&1; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
NC=$(tput sgr0)
else
RED=''
GREEN=''
BLUE=''
NC=''
fi
echo "${BLUE}Installing 8bitify...${NC}"
# 1. Dependency Checks
if ! command -v ffmpeg >/dev/null 2>&1; then
echo "${RED}Error: ffmpeg is not installed.${NC}"
echo "Please install it first:"
echo " macOS: brew install ffmpeg"
echo " Ubuntu: sudo apt install ffmpeg"
exit 1
fi
if ! command -v python3 >/dev/null 2>&1; then
echo "${RED}Error: python3 is not installed.${NC}"
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
echo "${RED}Error: git is not installed (required for installation).${NC}"
exit 1
fi
# 2. Setup Installation Directory
# If setup.py is present, we are running locally (git clone mode).
# If not, we are running via curl, so we need to clone to a temp dir.
CLEANUP_REQUIRED=false
INSTALL_DIR="."
if [ ! -f "setup.py" ]; then
echo "${BLUE}Fetching source code...${NC}"
# mktemp -d is mostly portable, works on macOS/Linux
INSTALL_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t '8bitify')
git clone --depth 1 https://github.com/IFAKA/8bitify.git "$INSTALL_DIR"
CLEANUP_REQUIRED=true
fi
# 3. Install
cd "$INSTALL_DIR" || exit 1
echo "${BLUE}Installing Python dependencies...${NC}"
# Try installing with --break-system-packages (for managed python environments)
# Fallback to standard install if that flag isn't supported/needed.
if python3 -m pip install . --break-system-packages >/dev/null 2>&1; then
SUCCESS=true
elif python3 -m pip install .; then
SUCCESS=true
else
SUCCESS=false
fi
# 4. Cleanup & Verify
if [ "$CLEANUP_REQUIRED" = true ]; then
cd ..
rm -rf "$INSTALL_DIR"
fi
if [ "$SUCCESS" = true ]; then
echo "${GREEN}8bitify successfully installed! 馃懢${NC}"
echo "Run it by typing: 8bitify"
else
echo "${RED}Installation failed. Please check your python/pip configuration.${NC}"
exit 1
fi