-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·40 lines (30 loc) · 1.08 KB
/
setup
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
#!/bin/bash
export XDG_CONFIG_HOME="$HOME/.config"
mkdir -p "$XDG_CONFIG_HOME"
# function to create or replace symlink
create_symlink() {
source_dir=$1
target_dir=$2
if [ -L "$target_dir" ]; then
rm "$target_dir"
elif [ -e "$target_dir" ]; then
echo "Error: $target_dir already exists and is not a symlink"
exit 1
fi
ln -s "$source_dir" "$target_dir"
}
create_symlink "$PWD/alacritty" "$XDG_CONFIG_HOME/alacritty"
create_symlink "$PWD/nvim" "$XDG_CONFIG_HOME/nvim"
create_symlink "$PWD/tmux" "$XDG_CONFIG_HOME/tmux"
create_symlink "$PWD/zsh/.zshrc" "$HOME/.zshrc"
create_symlink "$PWD/zsh/.zsh_profile" "$HOME/.zsh_profile"
create_symlink "$PWD/.gitconfig" "$HOME/.gitconfig"
# obsidian
create_symlink "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/Vault" "$HOME/Vault"
# setup pbsql
mkdir -p "$HOME/bin"
create_symlink "$PWD/scripts/pbsql/pbsql.sh" "$HOME/bin/pbsql"
# create pgcli config directory and link config
mkdir -p "$XDG_CONFIG_HOME/pgcli"
create_symlink "$PWD/pgcli/config" "$XDG_CONFIG_HOME/pgcli/config"
echo "Setup done"