Skip to content

Commit

Permalink
fix: formatting & zsh plugin standard (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster authored Nov 29, 2023
1 parent dc8cdad commit a47a36b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bin/git-dsf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Git will search $PATH for this file, when invoked by "git dsf ...".

f() {
[ -z "$GIT_PREFIX" ] || \
cd "$GIT_PREFIX" && \
git diff --color "$@" | diff-so-fancy | less --tabs=4 -iRFX
[ -z "$GIT_PREFIX" ] \
|| cd "$GIT_PREFIX" \
&& git diff --color "$@" | diff-so-fancy | less --tabs=4 -iRFX
}

f "$@"
9 changes: 5 additions & 4 deletions zsh-diff-so-fancy.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# See following web page for explanation of the line "ZERO=...":
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html

0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
local _pth="${0:h}/bin"
0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
0="${${(M)0:#/*}:-$PWD/$0}"
local diff_so_fancy_bin="${0:h}/bin"

if [[ -z "${path[(r)$_pth]}" ]]; then
path+=( "$_pth" )
if [[ -z "${path[(r)${diff_so_fancy_bin}]}" ]]; then
path+=( "${diff_so_fancy_bin}" )
fi

0 comments on commit a47a36b

Please sign in to comment.