-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
41 lines (36 loc) · 1.16 KB
/
setup.sh
File metadata and controls
41 lines (36 loc) · 1.16 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
# git clone https://github.com/alacritty/alacritty-theme ~/.config/alacritty/themes
# if mac run mac-setup.sh
# if linux run linux-setup.sh
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Function to source a script and call its function
run_setup_function() {
local script_path="$SCRIPT_DIR/$1"
local function_name="$2"
if [ -f "$script_path" ]; then
echo "🔹 Sourcing $(basename "$script_path")..."
source "$script_path" # Source the script so the function is available
echo "⚡ Running $function_name..."
"$function_name" # Call the function
else
echo "❌ Warning: $script_path not found. Skipping..."
fi
}
OS="$(uname -s)"
# Main installation function
setup() {
case "$OS" in
Darwin*) # macOS
echo "🚀 Detected macOS. Running mac-setup.sh..."
run_setup_function "mac-setup/mac-setup.sh" "mac_setup"
;;
Linux*) # Linux
echo "🚀 Detected Linux. Running linux-setup.sh..."
run_setup_function "linux-setup/linux-setup.sh" "linux_setup"
;;
*)
echo "❌ Unsupported operating system: $OS"
exit 1
;;
esac
}
setup