-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·78 lines (65 loc) · 1.55 KB
/
setup
File metadata and controls
executable file
·78 lines (65 loc) · 1.55 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
set -e
BLUE='\033[0;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NO_COLOR='\033[0m'
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODULES_DIR="$DOTFILES_DIR/modules"
ENV_FILE="$DOTFILES_DIR/.env"
if [ ! -f "$ENV_FILE" ]; then
echo -e "${RED}Missing .env file at $ENV_FILE — copy .env.example and fill in values${NO_COLOR}"
exit 1
fi
set -a
source "$ENV_FILE"
set +a
export DOTFILES_DIR
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
elif [[ "$OSTYPE" == "darwin"* ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
MODULES=(
"core"
"git"
"zsh"
"homebrew"
"delta"
"tmux"
"fnm"
"pyenv"
"dotnet"
"neovim"
"kiro"
"glazewm"
"scripts"
"personal-dir"
)
run_module() {
local module="$1"
local module_dir="$MODULES_DIR/$module"
local module_file="$module_dir/install.sh"
if [ ! -f "$module_file" ]; then
echo -e "${RED}Module $module not found${NO_COLOR}"
exit 1
fi
echo -e "${BLUE}Installing $module...${NO_COLOR}"
bash "$module_file"
}
if [ $# -eq 0 ]; then
echo -e "${BLUE}Usage: $0 [module|all]${NO_COLOR}"
echo -e "${BLUE}Modules: ${MODULES[*]}${NO_COLOR}"
exit 1
fi
if [ "$1" = "all" ]; then
for module in "${MODULES[@]}"; do
run_module "$module"
done
elif [[ " ${MODULES[*]} " =~ " $1 " ]]; then
run_module "$1"
else
echo -e "${RED}Unknown module: $1${NO_COLOR}"
exit 1
fi
echo -e "${GREEN}Installation completed!${NO_COLOR}"