mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 23:08:00 +00:00
Merge upstream/master
This commit is contained in:
commit
a70d24ab10
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
# function archive {
|
# function archive {
|
||||||
|
|
||||||
local archive_name dir_to_archive _gzip_bin _bzip2_bin
|
local archive_name path_to_archive _gzip_bin _bzip2_bin
|
||||||
|
|
||||||
if (( $# != 2 )); then
|
if (( $# < 2 )); then
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
usage: $0 [archive_name.zip] [/path/to/include/into/archive]
|
usage: $0 [archive_name.zip] [/path/to/include/into/archive ...]
|
||||||
|
|
||||||
Where 'archive.zip' uses any of the following extensions:
|
Where 'archive.zip' uses any of the following extensions:
|
||||||
|
|
||||||
@ -28,14 +28,8 @@ fi
|
|||||||
|
|
||||||
# strip the path, just in case one is provided for some reason
|
# strip the path, just in case one is provided for some reason
|
||||||
archive_name="${1:t}"
|
archive_name="${1:t}"
|
||||||
# use absolute paths, and follow symlinks
|
# let paths be handled by actual archive helper
|
||||||
dir_to_archive="${2}"
|
path_to_archive="${@:2}"
|
||||||
|
|
||||||
# if the directory doesn't exist, quit. Nothing to archive
|
|
||||||
if [[ ! -e "${dir_to_archive}" ]]; then
|
|
||||||
print "$0: file or directory not valid: ${dir_to_archive}" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# here, we check for dropin/multi-threaded replacements
|
# here, we check for dropin/multi-threaded replacements
|
||||||
# this should eventually be moved to modules/archive/init.zsh
|
# this should eventually be moved to modules/archive/init.zsh
|
||||||
@ -53,14 +47,14 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "${archive_name}" in
|
case "${archive_name}" in
|
||||||
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${dir_to_archive}" ;;
|
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
|
||||||
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${dir_to_archive}" ;;
|
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
|
||||||
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${dir_to_archive}" ;;
|
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${dir_to_archive}" ;;
|
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
|
||||||
(*.tar) tar -cvf "${archive_name}" "${dir_to_archive}" ;;
|
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.zip|*.jar) zip -r "${archive_name}" "${dir_to_archive}" ;;
|
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.rar) rar a "${archive_name}" "${dir_to_archive}" ;;
|
(*.rar) rar a "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.7z) 7za a "${archive_name}" "${dir_to_archive}" ;;
|
(*.7z) 7za a "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.gz) print "\n.gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;;
|
(*.gz) print "\n.gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;;
|
||||||
(*.bz2) print "\n.bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;;
|
(*.bz2) print "\n.bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;;
|
||||||
(*.xz) print "\n.xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;;
|
(*.xz) print "\n.xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;;
|
||||||
|
@ -17,7 +17,9 @@ elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
|||||||
# lookup mechanism (viz., `brew command command-not-found-init`) and instead
|
# lookup mechanism (viz., `brew command command-not-found-init`) and instead
|
||||||
# `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew.
|
# `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew.
|
||||||
elif (( $+commands[brew] )); then
|
elif (( $+commands[brew] )); then
|
||||||
cnf_command=("$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.NL+0))
|
cnf_command=(
|
||||||
|
"$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.N)
|
||||||
|
)
|
||||||
if (( $#cnf_command )); then
|
if (( $#cnf_command )); then
|
||||||
cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh"
|
cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh"
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
|||||||
- `gcm` records changes to the repository with the given message.
|
- `gcm` records changes to the repository with the given message.
|
||||||
- `gcS` records changes to the repository. (Signed)
|
- `gcS` records changes to the repository. (Signed)
|
||||||
- `gcSa` stages all modified and deleted files. (Signed)
|
- `gcSa` stages all modified and deleted files. (Signed)
|
||||||
- `gcSm` records changes to the repository with the given message. (Signed) - `gco` checks out a branch or paths to work tree.
|
- `gcSm` records changes to the repository with the given message. (Signed)
|
||||||
- `gcam` stages all modified and deleted files, and records changes to the repository with the given message.
|
- `gcam` stages all modified and deleted files, and records changes to the repository with the given message.
|
||||||
- `gco` checks out a branch or paths to work tree.
|
- `gco` checks out a branch or paths to work tree.
|
||||||
- `gcO` checks out hunks from the index or the tree interactively.
|
- `gcO` checks out hunks from the index or the tree interactively.
|
||||||
@ -81,6 +81,7 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
|||||||
commits.
|
commits.
|
||||||
- `gcR` removes the *HEAD* commit.
|
- `gcR` removes the *HEAD* commit.
|
||||||
- `gcs` displays various types of objects.
|
- `gcs` displays various types of objects.
|
||||||
|
- `gcsS` displays commits with GPG signature.
|
||||||
- `gcl` lists lost commits.
|
- `gcl` lists lost commits.
|
||||||
- `gcy` displays commits yet to be applied to upstream in the short format.
|
- `gcy` displays commits yet to be applied to upstream in the short format.
|
||||||
- `gcY` displays commits yet to be applied to upstream.
|
- `gcY` displays commits yet to be applied to upstream.
|
||||||
@ -220,6 +221,7 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
|||||||
- `glg` displays the graph log.
|
- `glg` displays the graph log.
|
||||||
- `glb` displays the brief commit log.
|
- `glb` displays the brief commit log.
|
||||||
- `glc` displays the commit count for each contributor in descending order.
|
- `glc` displays the commit count for each contributor in descending order.
|
||||||
|
- `glS` displays the log and checks the validity of signed commits.
|
||||||
|
|
||||||
### Merge
|
### Merge
|
||||||
|
|
||||||
@ -295,6 +297,8 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
|||||||
|
|
||||||
- `gt` lists tags or creates tag.
|
- `gt` lists tags or creates tag.
|
||||||
- `gtl` lists tags matching pattern.
|
- `gtl` lists tags matching pattern.
|
||||||
|
- `gts` creates a signed tag.
|
||||||
|
- `gtv` validate a signed tag.
|
||||||
|
|
||||||
### Working directory
|
### Working directory
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
|
|||||||
alias gcr='git revert'
|
alias gcr='git revert'
|
||||||
alias gcR='git reset "HEAD^"'
|
alias gcR='git reset "HEAD^"'
|
||||||
alias gcs='git show'
|
alias gcs='git show'
|
||||||
alias gpS='git show --pretty=short --show-signature'
|
alias gcsS='git show --pretty=short --show-signature'
|
||||||
alias gcl='git-commit-lost'
|
alias gcl='git-commit-lost'
|
||||||
alias gcy='git cherry -v --abbrev'
|
alias gcy='git cherry -v --abbrev'
|
||||||
alias gcY='git cherry -v'
|
alias gcY='git cherry -v'
|
||||||
|
@ -15,9 +15,10 @@ fi
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Load standard Homebrew shellenv into the shell session.
|
# Load standard Homebrew shellenv into the shell session.
|
||||||
# `brew shellenv` is relatively new, guard for legacy Homebrew.
|
# Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related
|
||||||
|
# variables as they are already handled in standard zsh configuration.
|
||||||
if (( $+commands[brew] )); then
|
if (( $+commands[brew] )); then
|
||||||
eval "$(brew shellenv 2> /dev/null)"
|
eval "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -45,12 +46,11 @@ alias casks='hb_deprecated brew cask search'
|
|||||||
alias caskx='brew cask uninstall'
|
alias caskx='brew cask uninstall'
|
||||||
|
|
||||||
function hb_deprecated {
|
function hb_deprecated {
|
||||||
local cmd="${argv[3]}"
|
local cmd="${@[3]}"
|
||||||
local cmd_args=( ${(@)argv:4} )
|
local cmd_args="${@:4}"
|
||||||
|
|
||||||
printf "'brew cask %s' has been deprecated, " "${cmd}"
|
printf "'brew cask %s' has been deprecated, " "${cmd}"
|
||||||
printf "using 'brew %s' instead\n" "${cmd}"
|
printf "using 'brew %s' instead\n" "${cmd}"
|
||||||
|
|
||||||
cmd_args=( ${(@)argv:4} )
|
command brew "${cmd}" "${=cmd_args}"
|
||||||
command brew "${cmd}" ${(@)cmd_args}
|
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,9 @@ if (( $#commands[(i)pip(|[23])] )); then
|
|||||||
|| ! -s "$cache_file" ]]; then
|
|| ! -s "$cache_file" ]]; then
|
||||||
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
||||||
$pip_command completion --zsh \
|
$pip_command completion --zsh \
|
||||||
| sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip.*|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null
|
| sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \
|
||||||
|
>! "$cache_file" \
|
||||||
|
2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "$cache_file"
|
source "$cache_file"
|
||||||
|
Loading…
Reference in New Issue
Block a user