-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (46 loc) · 1013 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·53 lines (46 loc) · 1013 Bytes
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
#!/usr/bin/env bash
# Common packages (same name in brew and apt)
common_packages=(
git
ripgrep
fzf
bat
eza
jq
fish
neovim
zig
luacheck
stylua
)
# Detect OS
os_name=$(uname -s | tr '[:upper:]' '[:lower:]')
# Validate OS
if [ "$os_name" != "darwin" ] && [ "$os_name" != "linux" ]; then
echo "Error: Unsupported operating system: $os_name"
exit 1
fi
# Function to install packages using Homebrew
install_brew() {
echo "Installing packages using Homebrew..."
brew install "$@"
}
# Function to install packages using apt
install_apt() {
echo "Installing packages using apt..."
sudo apt-get update
sudo apt-get install -y "$@"
}
# Install common packages
if [ "$os_name" = "darwin" ]; then
install_brew "${common_packages[@]}"
elif [ "$os_name" = "linux" ]; then
install_apt "${common_packages[@]}"
fi
# Install fd with OS-specific name
if [ "$os_name" = "darwin" ]; then
install_brew fd
install_brew mise
elif [ "$os_name" = "linux" ]; then
install_apt fd-find
fi