blob: d2ffb34282a409d8a71b3c8a874cc4b0160bb3f3 (
plain)
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
|
#!/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
git diff --no-commit-id --name-status -r
git diff --no-commit-id --name-status -r --staged
) |
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
|