Skip to content

Commit

Permalink
Update zinit.zsh
Browse files Browse the repository at this point in the history
Added a check before cp'ing non-existent file
  • Loading branch information
ethnh authored Nov 8, 2024
1 parent 0c471af commit 02f14bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1320,8 +1320,9 @@ builtin setopt noaliases
command mkdir 2>/dev/null -p ${~ZINIT[MAN_DIR]}/man{1..9}
}
# Copy Zinit manpage so that man is able to find it
[[ ! -f $ZINIT[MAN_DIR]/man1/zinit.1 || \
$ZINIT[MAN_DIR]/man1/zinit.1 -ot $ZINIT[BIN_DIR]/doc/zinit.1 ]] && {
[[ ! -f $ZINIT[MAN_DIR]/man1/zinit.1 || \ # check for dest file NOT exists
$ZINIT[MAN_DIR]/man1/zinit.1 -ot $ZINIT[BIN_DIR]/doc/zinit.1 ]] &&
[[ -f $ZINIT[BIN_DIR]/doc/zinit.1 ]] && { # check for source file exists
command mkdir -p $ZINIT[MAN_DIR]/man1
command cp -f $ZINIT[BIN_DIR]/doc/zinit.1 $ZINIT[MAN_DIR]/man1
}
Expand Down

0 comments on commit 02f14bf

Please sign in to comment.