#!/bin/sh set -e MOV=false B="${0%/*}" [ -f "$B" ] &&B="." cd "$B" if ! [ -d "$HOME" ]; then printf '%s\n' "error. $HOME - no folder" exit 1 fi confirm() { printf '%s\n' " :remember to look at the sources." printf '%s' "=> update ${HOME}/*? (y/n) " read REPLY case "$REPLY" in y|Y) MOV=true ;; *) : ;; esac } move() { $MOV &&cp -r "$@" "$HOME" $MOV ||printf "(would've)" printf ' %s' 'moved [' "$@" '] ' } md() {( D=$(dirname "$1") $MOV &&printf 'mkdir -p '"$HOME"'/%s\n' "$D"|sh $MOV &&cp -r "$1" "$HOME/$D" $MOV ||printf "(would've)" printf ' %s' 'moved [' "$1" '] ' )} confirm if [ $(id -u) != 0 ]; then md .config/fontconfig/fonts.conf md .config/mpv md .config/feh #move .xinitrc move .dirash .mkshrc fi move .profile .aliases