1 files changed,
19 insertions(+),
9 deletions(-)
Author:
Smirnov Oleksandr
ss2316544@gmail.com
Committed at:
2024-10-30 14:40:53 +0200
Parent:
a7f3f62
M
bootstrap
ยทยทยท 5 5 # set to specific path so this script can be run from anywhere 6 6 dotfilesPath="$HOME/.dotfiles" 7 7 8 +h() { # ln -sf and logs path 9 + ln -sf "$1" "$2" 10 + echo "[ln] $2" 11 +} 12 + 13 +mkd() { # mkdir -p and logs path 14 + mkdir -p "$1" 15 + echo "[mkdir] $1" 16 +} 17 + 8 18 create_links_in_dir_recursively() { 9 19 local base_dir="$dotfilesPath/$1" 10 20 local target_dir="$2" 11 21 12 22 find "$base_dir/" -type d | while read -r dir; do 13 - mkdir -p "$HOME/$target_dir${dir#"$base_dir"}" 23 + mkd "$HOME/$target_dir${dir#"$base_dir"}" 14 24 find "$dir" -maxdepth 1 -type f | while read -r file; do 15 - ln -sf "$file" "$HOME/$target_dir${file#"$base_dir"}" 25 + h "$file" "$HOME/$target_dir${file#"$base_dir"}" 16 26 done 17 27 done 18 28 } 19 29 20 -ln -sf "$dotfilesPath/zshrc" "$HOME/.zshrc" 21 -ln -sf "$dotfilesPath/gitconfig" "$HOME/.gitconfig" 22 -ln -sf "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf" 30 +h "$dotfilesPath/zshrc" "$HOME/.zshrc" 31 +h "$dotfilesPath/gitconfig" "$HOME/.gitconfig" 32 +h "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf" 23 33 24 -mkdir -p "$HOME/bin/" 34 +mkd "$HOME/bin/" 25 35 find "$dotfilesPath/bin" -type f -exec ln -sf {} "$HOME/bin/" \; 26 36 27 37 create_links_in_dir_recursively "config" ".config" 28 -ln -sf "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml" 29 -ln -sf "$dotfilesPath/config/electron-flags.conf" "$HOME/.config/electron-flags.conf" 30 -ln -sf "$dotfilesPath/config/starship.toml" "$HOME/.config/starship.toml" 38 +h "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml" 39 +h "$dotfilesPath/config/electron-flags.conf" "$HOME/.config/electron-flags.conf" 40 +h "$dotfilesPath/config/starship.toml" "$HOME/.config/starship.toml" 31 41 32 42 create_links_in_dir_recursively "logseq" ".logseq"