aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/install.sh
blob: 1bd59c614ae7fd9fb157d59b015bfd71e96afc12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# shellcheck disable=SC2035,SC2016

set -e

CDPATH='' cd -- "$(dirname -- "$0")" || exit

printf "%s: Removing bad links\n" "$0"
git diff-tree --no-commit-id --name-status e6051a3..HEAD -r |
	grep -oP 'D\t[^/]+/\K(.*)' |
	while read -r f; do
		if [ -L "../$f" ] && [ ! -e "../$f" ]; then
			rm -v "../$f"
		fi
	done

printf "%s: Stowing packages\n" "$0"
stow "$@" */

for f in */install.sh; do
	$f
done