-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
69 lines (62 loc) · 1.45 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
#!/bin/bash
set -euxo pipefail
# Function to check if kitty is installed
is_kitty_installed() {
if command -v kitty &> /dev/null; then
return 0
else
return 1
fi
}
# Function to install kitty on macOS
install_kitty_mac() {
echo ">>>>> Will install kitty"
brew tap ImSingee/kitty
brew install kitty
}
# Function to install kitty on Linux
install_kitty_linux() {
echo ">>>>> Will install kitty"
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
KITTY_URL="https://go.singee.site/kitty/latest-linux-$ARCH.tar.gz"
curl -o /tmp/kitty.tar.gz $KITTY_URL
tar -xzf /tmp/kitty.tar.gz -C /tmp
mv /tmp/kitty /usr/local/bin/kitty
chmod +x /usr/local/bin/kitty
}
# Function to run kitty install command
run_kitty_install() {
kitty install --from-direnv
}
# Detect the operating system
OS=$(uname)
if is_kitty_installed; then
echo "Kitty is already installed."
else
if [ "$OS" = "Darwin" ]; then
# macOS system detected
install_kitty_mac
elif [ "$OS" = "Linux" ]; then
# Linux system detected
install_kitty_linux
else
echo "Unsupported operating system: $OS"
exit 1
fi
fi
# Run the kitty install command
if [ -d ".git" ]; then
run_kitty_install
fi