-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·37 lines (25 loc) · 876 Bytes
/
setup.sh
File metadata and controls
executable file
·37 lines (25 loc) · 876 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
#!/bin/bash
home_dir="$HOME"
files=$(find . -type f \( ! -name "Readme.adoc" -a ! -name "setup.sh" -a ! -path "./.git/*" -a ! -name ".gitignore" \) | sed 's|^\./||')
mkdir $HOME/.config
mkdir $HOME/.config/nvim
mkdir $HOME/.config/nvim/lua
mkdir $HOME/.config/nvim/lua/plugins
mkdir $HOME/.config/foot
for file in $files; do
target_path="$home_dir/$file"
ln -P -f "$PWD/$file" "$target_path"
echo "Created hard symlink '$target_path' pointing to '$PWD/$file'"
done
# Now do for root
sudo mkdir /root/.config
sudo mkdir /root/.config/nvim
sudo mkdir /root/.config/nvim/lua
sudo mkdir /root/.config/nvim/lua/plugins
sudo mkdir /root/.config/foot
for file in $files; do
target_path="/root/$file"
sudo ln -P -f "$PWD/$file" "$target_path"
echo "Created hard symlink '$target_path' pointing to '$PWD/$file'"
done
echo "Dotfile setup complete."