WIP: Script to automatically link files
Takes the source path from PWD and the symlink path and creates them all. Not tested, just building list.
This commit is contained in:
parent
68ada8a315
commit
659c8efaca
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# <relative location to $PWD>:<absolute path of link>
|
||||
# '~' will be expanded to $HOME
|
||||
LINKS="
|
||||
alacritty/alacritty.yml:~/alacritty.yml
|
||||
bash/bashrc:~/.bashrc
|
||||
bash/bash_login:~/.bash_login
|
||||
bash/bash_logout:~/.bash_logout
|
||||
bash/bash_profile:~/.bash_profile
|
||||
nvim:~/.config/nvim
|
||||
vim/vimrc:~/.vimrc
|
||||
fonts:~/.fonts
|
||||
icons:~/.icons
|
||||
"
|
||||
|
||||
SUDO="
|
||||
"
|
||||
|
||||
for i in $LINKS; do
|
||||
DEST=$PWD/$(echo "${i}" | cut -d: -f1)
|
||||
LINK=$(echo "$i" | cut -d: -f2 | sed -E "s#~#$HOME#")
|
||||
CMD="ln -s $DEST $LINK"
|
||||
eval "$CMD"
|
||||
done
|
||||
|
||||
for i in $SUDO; do
|
||||
DEST=$PWD/$(echo "${i}" | cut -d: -f1)
|
||||
LINK=$(echo "$i" | cut -d: -f2 | sed -E "s#~#$HOME#")
|
||||
CMD="sudo ln -s $DEST $LINK"
|
||||
eval "$CMD"
|
||||
done
|
Loading…
Reference in New Issue