mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
refactor(bootstrap): make shellcheck happy....
btw while making this commit i just questioned why the f i did? i mean it works, then why to rewrite it
This commit is contained in:
parent
451e274635
commit
a7f3f62e40
1 changed files with 8 additions and 10 deletions
18
bootstrap
18
bootstrap
|
|
@ -6,15 +6,15 @@ set -e
|
||||||
dotfilesPath="$HOME/.dotfiles"
|
dotfilesPath="$HOME/.dotfiles"
|
||||||
|
|
||||||
create_links_in_dir_recursively() {
|
create_links_in_dir_recursively() {
|
||||||
local base_dir="$dotfilesPath/$1"
|
local base_dir="$dotfilesPath/$1"
|
||||||
local target_dir="$2"
|
local target_dir="$2"
|
||||||
|
|
||||||
for dir in $(find "$base_dir/" -type d); do
|
find "$base_dir/" -type d | while read -r dir; do
|
||||||
mkdir -p "$HOME/$target_dir${dir#$base_dir}"
|
mkdir -p "$HOME/$target_dir${dir#"$base_dir"}"
|
||||||
for file in $(find "$dir" -maxdepth 1 -type f); do
|
find "$dir" -maxdepth 1 -type f | while read -r file; do
|
||||||
ln -sf "$file" "$HOME/$target_dir${file#$base_dir}"
|
ln -sf "$file" "$HOME/$target_dir${file#"$base_dir"}"
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
ln -sf "$dotfilesPath/zshrc" "$HOME/.zshrc"
|
ln -sf "$dotfilesPath/zshrc" "$HOME/.zshrc"
|
||||||
|
|
@ -22,9 +22,7 @@ ln -sf "$dotfilesPath/gitconfig" "$HOME/.gitconfig"
|
||||||
ln -sf "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf"
|
ln -sf "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf"
|
||||||
|
|
||||||
mkdir -p "$HOME/bin/"
|
mkdir -p "$HOME/bin/"
|
||||||
for file in $(find "$dotfilesPath/bin" -type f); do
|
find "$dotfilesPath/bin" -type f -exec ln -sf {} "$HOME/bin/" \;
|
||||||
ln -sf "$file" "$HOME/bin"
|
|
||||||
done
|
|
||||||
|
|
||||||
create_links_in_dir_recursively "config" ".config"
|
create_links_in_dir_recursively "config" ".config"
|
||||||
ln -sf "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml"
|
ln -sf "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue