all repos

dotfiles @ 451e274

i use rach linux btw
1 files changed, 12 insertions(+), 8 deletions(-)
bootstrap: refactor, make it run from anywhere
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-10-22 12:45:30 +0300
Parent: 049ea27
M bootstrap
···
        1
        1
         #!/usr/bin/env bash

      
        2
        2
         set -e

      
        3
        3
         

      
        
        4
        +# the path to dir where the script and dotfiles are located

      
        
        5
        +# set to specific path so this script can be run from anywhere

      
        
        6
        +dotfilesPath="$HOME/.dotfiles"

      
        
        7
        +

      
        4
        8
         create_links_in_dir_recursively() {

      
        5
        
        -    local base_dir="$PWD/$1"

      
        
        9
        +    local base_dir="$dotfilesPath/$1"

      
        6
        10
             local target_dir="$2"

      
        7
        11
         

      
        8
        12
             for dir in $(find "$base_dir/" -type d); do

      ···
        13
        17
             done

      
        14
        18
         }

      
        15
        19
         

      
        16
        
        -ln -sf "$PWD/zshrc" "$HOME/.zshrc"

      
        17
        
        -ln -sf "$PWD/gitconfig" "$HOME/.gitconfig"

      
        18
        
        -ln -sf "$PWD/tmux.conf" "$HOME/.tmux.conf"

      
        
        20
        +ln -sf "$dotfilesPath/zshrc" "$HOME/.zshrc"

      
        
        21
        +ln -sf "$dotfilesPath/gitconfig" "$HOME/.gitconfig"

      
        
        22
        +ln -sf "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf"

      
        19
        23
         

      
        20
        24
         mkdir -p "$HOME/bin/"

      
        21
        
        -for file in $(find "$PWD/bin" -type f); do

      
        
        25
        +for file in $(find "$dotfilesPath/bin" -type f); do

      
        22
        26
             ln -sf "$file" "$HOME/bin"

      
        23
        27
         done

      
        24
        28
         

      
        25
        29
         create_links_in_dir_recursively "config" ".config"

      
        26
        
        -ln -sf "$PWD/config/alacritty.yml" "$HOME/.config/alacritty.yml"

      
        27
        
        -ln -sf "$PWD/config/electron-flags.conf" "$HOME/.config/electron-flags.conf"

      
        28
        
        -ln -sf "$PWD/config/starship.toml" "$HOME/.config/starship.toml"

      
        
        30
        +ln -sf "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml"

      
        
        31
        +ln -sf "$dotfilesPath/config/electron-flags.conf" "$HOME/.config/electron-flags.conf"

      
        
        32
        +ln -sf "$dotfilesPath/config/starship.toml" "$HOME/.config/starship.toml"

      
        29
        33
         

      
        30
        34
         create_links_in_dir_recursively "logseq" ".logseq"