diff options
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1,5 +1,5 @@ #!/bin/sh -# shellcheck disable=SC2035,SC2016 +# shellcheck disable=SC2035 set -e @@ -7,17 +7,26 @@ CDPATH='' cd -- "$(dirname -- "$0")" || exit printf "%s: Removing bad links\n" "$0" { - git log --pretty=format: --name-only --no-renames --diff-filter=D - git status --porcelain --no-renames | grep -oP '^\s*\w*[DR?]+\w*\s*\K(.*)' + git log --name-only --no-renames --diff-filter=D --format=format: + git diff --name-only --no-renames --diff-filter=D HEAD + if [ -f .untracked ]; then + cat .untracked + fi } | sort -u | sed -n 's/^[^/]\+\//..\//p' | while read -r f; do if [ -L "$f" ] && [ ! -e "$f" ]; then rm -v "$f" fi done +git ls-files --exclude-standard --others >.untracked +if [ ! -s .untracked ]; then + rm -f .untracked +fi + printf "%s: Stowing packages\n" "$0" stow "$@" */ +printf "%s: Installing packages\n" "$0" for f in */install.sh; do $f done |