ulthar.xyz > Repos

dotfiles

Seven years worth of accumulated configuration cruft
About Files Commits git clone https://ulthar.xyz/repos/dotfiles/dotfiles.git

dotfiles/unmk

Download raw file: unmk

#!/bin/sh

. ./mk

remove_parents() {
	dir="$1"
	[ -n "$(ls -A "$dir")" ] && return 0
	rmdir "$dir"
	remove_parents "$(dirname "$dir")"
}

uninstall_file() {
	file="$1"
	trgt="$2"
	link="$3"
	[ -L "$link" ] && [ "$(realpath "$link")" = "$trgt" ] || return 0
	echo "  Removing link ~/$file..."
	rm -f "$link"
	remove_parents "$(dirname "$link")"
}

action="uninstall_file" main "$@"

Generated 2025-03-07 15:24:27 -0700 by RepoRat