Merge branch 'master' of ssh://git.blake.ly:6102/PowerUser/dotfiles
This commit is contained in:
commit
6494e36ae1
1 changed files with 8 additions and 13 deletions
|
@ -51,21 +51,16 @@ contains() {
|
|||
pretty_path() {
|
||||
arg="$1"
|
||||
|
||||
# If the arg starts with our home dir, replace the prefix with a tilde
|
||||
case "$arg" in
|
||||
# If the arg starts with our home dir,
|
||||
"$HOME"*)
|
||||
# replace the home dir part with a ~
|
||||
printf '~%s' "$(printf '%s' "$arg" | sed -E 's/^.{'"${#HOME}"'}//')"
|
||||
arg="~${arg#"$HOME"}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Otherwise,
|
||||
*)
|
||||
# Just print the arg
|
||||
printf '%s' "${arg}"
|
||||
;;
|
||||
esac | # Pass through some other filters
|
||||
sed -E 's_/+$__' | # Remove trailing slash
|
||||
tr -s '/' # Remove duplicate slashes
|
||||
printf '%s' "$arg" |
|
||||
tr -s '/' | # Remove duplicate slashes
|
||||
sed 's+/$++' # Remove trailing slash
|
||||
}
|
||||
|
||||
# Warn about incomplete changes to a repository
|
||||
|
@ -101,7 +96,7 @@ do_pull() {
|
|||
for repo in "$@"; do
|
||||
if [ -n "$repo" ]; then
|
||||
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)"
|
||||
if [ -n "$repo" ]; then
|
||||
if ! contains "$repo" ':' "$updated"; then
|
||||
|
@ -133,7 +128,7 @@ do_pull() {
|
|||
${did_updates:-false} && echo
|
||||
echo " Updating ${green}dotfiles${nc}…"
|
||||
dotfiles pull
|
||||
do_checks "$(dotfiles rev-parse --git-dir)" dotfiles
|
||||
do_checks "$(pretty_path "$(dotfiles rev-parse --git-dir)")" dotfiles
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue