-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (23 loc) · 816 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SCRIPTS_DIRECTORY = $$HOME/.local/scripts
all: directories scripts
clean: clean-directories clean-scripts
directories: clean-directories
stow --verbose --target=$$HOME --ignore=scripts --restow */
clean-directories:
mkdir -p $$HOME
stow --verbose --target=$$HOME --ignore=scripts --delete */
scripts: clean-scripts
mkdir -p ${SCRIPTS_DIRECTORY}
find $$PWD/*/.local/scripts/ -type f -exec ln -s "{}" ${SCRIPTS_DIRECTORY}/ \;
clean-scripts:
mkdir -p ${SCRIPTS_DIRECTORY}
find $$PWD/*/.local/scripts -maxdepth 1 -type f -printf "%f\n" | \
xargs -I{} sh -c 'unlink ${SCRIPTS_DIRECTORY}/{} || true'
snapshot: HOME=/tmp/archie-home
snapshot: all
find $$HOME -type l | \
sort | \
xargs -I{} zsh -c 'printf "%-45s %s\n" "{}" "$$(readlink -f {})"' | \
sd $$PWD "REPO" | \
sd $$HOME "HOME" \
>snapshot