aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index 22cfb6a..bba2a51 100755
--- a/install.sh
+++ b/install.sh
@@ -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