-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall_mac.sh
More file actions
executable file
·60 lines (45 loc) · 1.74 KB
/
install_mac.sh
File metadata and controls
executable file
·60 lines (45 loc) · 1.74 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
#!/bin/bash
set -e # Exit immediately if a command exits with non-zero status
# Get version from remote version file
echo "Fetching latest version information..."
VERSION_URL="https://raw.githubusercontent.com/aallali/DeepEye/main/version.txt"
VERSION=$(curl -s ${VERSION_URL})
if [ -z "$VERSION" ]; then
echo "ERROR: Failed to retrieve version information"
exit 1
fi
EXECUTABLE_VERSION="0.0.3"
EXECUTABLE_NAME="deepeye-${EXECUTABLE_VERSION}"
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="deepeye"
DOWNLOAD_URL="https://github.com/aallali/DeepEye/releases/download/${EXECUTABLE_VERSION}/${EXECUTABLE_NAME}-darwin-amd64.tar.gz"
echo "Latest version: ${EXECUTABLE_VERSION}"
echo "Download URL: ${DOWNLOAD_URL}"
# Check if running as root or with sudo
if [ "$(id -u)" -ne 0 ]; then
echo "ERROR: This script must be run with sudo"
exit 1
fi
echo "Downloading DeepEye ${EXECUTABLE_VERSION}..."
curl -s -L -o "${EXECUTABLE_NAME}.tar.gz" "${DOWNLOAD_URL}" ||
{ echo "Failed to download DeepEye"; exit 1; }
echo "Extracting..."
tar -xf "${EXECUTABLE_NAME}.tar.gz" ||
{ echo "Failed to extract DeepEye"; exit 1; }
echo "Installing to ${INSTALL_DIR}/${BINARY_NAME}..."
# Remove old binary if exists
rm -f "${INSTALL_DIR}/${BINARY_NAME}"
# Install new binary
install -m 755 "${EXECUTABLE_NAME}-darwin-amd64" "${INSTALL_DIR}/${BINARY_NAME}" ||
{ echo "Failed to install DeepEye"; exit 1; }
# Clean up
rm -f "${EXECUTABLE_NAME}.tar.gz" "${EXECUTABLE_NAME}-darwin-amd64"
echo "DeepEye ${EXECUTABLE_VERSION} installed successfully!"
echo "Run 'deepeye -h' for usage information"
cat << EOF
To enable automatic update checks, add to your shell config:
For Bash users:
echo "deepeye -u" >> ~/.bash_profile
For Zsh users:
echo "deepeye -u" >> ~/.zshrc
EOF