~charles/dotfiles

dotfiles/install-lite.sh -rwxr-xr-x 470 bytes
ca364fe3Charles Daniels add oshrc 11 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# install overlay
cd "$(dirname "$0")"
DOTFILES_DIR="$(pwd)"
OVERLAY_DIR="$DOTFILES_DIR/overlay.lite"
DEST_DIR="$HOME"

mkdir -p ~/.vimbak

cd "$OVERLAY_DIR"

find -L . -type f | while read -r target ; do
	target_relparent="$(dirname "$target")"
	dest_parent="$DEST_DIR/$target_relparent"
	dest_file="$DEST_DIR/$target"
	rm -f "$dest_file"
	mkdir -p "$dest_parent"
	cat "$target" > "$dest_file"
	chmod "$(stat -L -c "%a" "$target")" "$dest_file"
done

exit 0