-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·70 lines (58 loc) · 1.51 KB
/
install.sh
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
#!/bin/sh
#
# install.sh
# Genius
#
# © 2024 F1248 <[email protected]>
# See LICENSE.txt for license information.
#
PATH="/usr/bin:/bin"
set -e
is_recoveryos=$([[ ! -e /System/Library/CoreServices/Finder.app ]] && echo true || echo false)
if $is_recoveryos; then
if [[ ! $(sw_vers -productVersion | cut -d "." -f 1) -ge 14 ]]; then
echo "\nError: Genius requires macOS Sonoma 14 or later in recoveryOS!\n"
exit 1
fi
echo "\nNote: Genius only remains installed until restarting."
else
if [[ ! $(sw_vers -productVersion | cut -d "." -f 1) -ge 11 ]]; then
echo "\nError: Genius requires macOS Big Sur 11 or later!\n"
exit 1
fi
fi
echo "\nQuitting Genius..."
if $is_recoveryos; then
killall -q Genius || true
else
for _ in $(pgrep -x Genius); do
osascript -e "quit app \"Genius\""
done
fi
echo "Preparing..."
if [[ -w /Applications ]]; then
cd /Applications
else
mkdir -p ~/Applications
cd ~/Applications
fi
echo "Downloading..."
curl --no-progress-meter --remote-name --location https://nightly.link/F1248/Genius/workflows/Build-Genius/main/Genius.zip
echo "Installing..."
unzip -q -o Genius.zip
rm -r -f Genius.app
unzip -q Genius.zip
if $is_recoveryos; then
echo "Creating alias..."
echo "\nalias genius=\"$PWD/Genius.app/Contents/MacOS/Genius &> /dev/null\"" >> ~/.bash_profile
fi
echo "Cleaning up..."
rm Genius.zip
echo "Opening..."
if $is_recoveryos; then
Genius.app/Contents/MacOS/Genius &> /dev/null
echo "\nNote: To reopen Genius run \`genius\` in a new shell.\n"
else
open Genius.app
fi
echo "Done."