-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·74 lines (55 loc) · 1.63 KB
/
setup.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
71
72
73
74
#!/bin/bash
DOTFILES_DIR="$HOME/dotfiles"
NVIM_CONFIG_DIR="$HOME/.config/nvim"
WEZTERM_CONFIG_DIR="$HOME"
SHELDON_CONFIG_DIR="$HOME/.config/sheldon"
ZSH_CONFIG_DIR="$HOME"
link_nvim_config() {
if [ ! -d "$NVIM_CONFIG_DIR" ]; then
mkdir -p "$NVIM_CONFIG_DIR"
fi
for file in "$DOTFILES_DIR"/config/nvim/*; do
ln -snfv "$file" "$NVIM_CONFIG_DIR/$(basename "$file")"
done
}
link_wezterm_config() {
if [ ! -d "$WEZTERM_CONFIG_DIR" ]; then
mkdir -p "$WEZTERM_CONFIG_DIR"
fi
ln -snfv "$DOTFILES_DIR"/config/wezterm/.wezterm.lua "$HOME/.wezterm.lua"
}
link_sheldon_config() {
if [ ! -d "$SHELDON_CONFIG_DIR" ]; then
mkdir -p "$SHELDON_CONFIG_DIR"
fi
ln -snfv "$DOTFILES_DIR"/config/sheldon/plugins.toml "$HOME/.config/sheldon/plugins.toml"
}
link_zsh_config() {
if [ ! -d "$ZSH_CONFIG_DIR" ]; then
mkdir -p "$ZSH_CONFIG_DIR"
fi
ln -snfv "$DOTFILES_DIR"/config/zsh/.zshrc "$HOME/.zshrc"
ln -snfv "$DOTFILES_DIR"/config/zsh/.p10k.zsh "$HOME/.p10k.zsh"
}
main() {
echo "Start setup dotfiles..."
if ! command -v npm >/dev/null 2>&1; then
echo "Error: npm is not installed or not in PATH"
exit 1
fi
echo "Install npm packages..."
if ! npm install -g typescript typescript-language-server vue-language-server tailwindcss-language-server eslint_d stylelint; then
echo "Error: Failed to install npm packages"
exit 1
fi
link_nvim_config
echo "Linking neovim config done."
link_wezterm_config
echo "Linking wezterm config done."
link_sheldon_config
echo "Linking sheldon config done."
link_zsh_config
echo "Linking zsh config done."
echo "Setup dotfiles done."
}
main