Merge branch 'master' of ssh://git.blake.ly:6102/PowerUser/dotfiles

This commit is contained in:
PowerUser64 2025-05-25 22:12:33 -07:00
commit 6494e36ae1

View file

@ -51,21 +51,16 @@ contains() {
pretty_path() { pretty_path() {
arg="$1" arg="$1"
# If the arg starts with our home dir, replace the prefix with a tilde
case "$arg" in case "$arg" in
# If the arg starts with our home dir,
"$HOME"*) "$HOME"*)
# replace the home dir part with a ~ arg="~${arg#"$HOME"}"
printf '~%s' "$(printf '%s' "$arg" | sed -E 's/^.{'"${#HOME}"'}//')"
;; ;;
esac
# Otherwise, printf '%s' "$arg" |
*) tr -s '/' | # Remove duplicate slashes
# Just print the arg sed 's+/$++' # Remove trailing slash
printf '%s' "${arg}"
;;
esac | # Pass through some other filters
sed -E 's_/+$__' | # Remove trailing slash
tr -s '/' # Remove duplicate slashes
} }
# Warn about incomplete changes to a repository # Warn about incomplete changes to a repository
@ -101,7 +96,7 @@ do_pull() {
for repo in "$@"; do for repo in "$@"; do
if [ -n "$repo" ]; then if [ -n "$repo" ]; then
repo_pretty="$(pretty_path "$repo")" repo_pretty="$(pretty_path "$repo")"
repo="$(realpath "$repo" 2>/dev/null)" repo="$(realpath "$repo" 2>/dev/null || true)"
repo="$(git -C "$repo" rev-parse --show-toplevel 2> /dev/null || true)" repo="$(git -C "$repo" rev-parse --show-toplevel 2> /dev/null || true)"
if [ -n "$repo" ]; then if [ -n "$repo" ]; then
if ! contains "$repo" ':' "$updated"; then if ! contains "$repo" ':' "$updated"; then
@ -133,7 +128,7 @@ do_pull() {
${did_updates:-false} && echo ${did_updates:-false} && echo
echo " Updating ${green}dotfiles${nc}…" echo " Updating ${green}dotfiles${nc}…"
dotfiles pull dotfiles pull
do_checks "$(dotfiles rev-parse --git-dir)" dotfiles do_checks "$(pretty_path "$(dotfiles rev-parse --git-dir)")" dotfiles
fi fi
} }