this repo has no description

slightly nicer setup output

seth.computer 02beff57 6fa20322

verified
+17 -10
+17 -10
setup.sh
··· 2 2 3 3 set -euo pipefail 4 4 5 + DOTFILES_DIR="$HOME/dotfiles" 6 + 5 7 function link_configs { 8 + echo "Linking configuration files..." 9 + 6 10 declare -A mappings 7 11 8 12 # TODO: Make this linux compatible ··· 17 21 mappings["misc/global-tool-versions"]="$HOME/.tool-versions" 18 22 19 23 for key in "${!mappings[@]}"; do 20 - source="$PWD/${key}" 24 + source="${key}" 21 25 destination="${mappings[$key]}" 22 26 23 27 if [ -d "$source" ]; then ··· 35 39 local source="$1" 36 40 local destination="$2" 37 41 42 + echo "$source -> $destination" 43 + 38 44 if [ -L "$destination" ]; then 39 - if [ "$(readlink "$destination")" = "$source" ]; then 40 - echo "Symlink $destination already points to $source, skipping." 45 + if [ "$(readlink "$destination")" = "$DOTFILES_DIR/$source" ]; then 46 + echo " Already established" 41 47 return 42 48 else 43 - echo "Removing existing symlink $destination that points to $(readlink "$destination")." 49 + echo " Removing existing symlink ($(readlink "$destination"))" 44 50 rm "$destination" 45 51 fi 46 52 fi 47 53 48 54 if [ -e "$destination" ]; then 49 - echo "Destination $destination already exists and is not a symlink. Backing it up." 55 + echo " Destination exists, backing it up" 50 56 mv "$destination" "${destination}.bak" 51 57 fi 52 58 53 - echo "Creating symlink from $source to $destination." 54 - ln -s "$source" "$destination" 59 + echo " Creating symlink" 60 + ln -s "$DOTFILES_DIR/$source" "$destination" 55 61 } 56 62 57 63 function install_oh_my_zsh { 58 - if [ ! -d "$HOME/.oh-my-zsh" ]; then 59 - echo "Installing oh my zsh..." 60 - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended 64 + if [ -d "$HOME/.oh-my-zsh" ]; then 65 + echo "Oh My Zsh is already installed." 66 + return 61 67 fi 68 + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended 62 69 } 63 70 64 71 function install_tpm {