1
0
Fork 0
mirror of https://github.com/zplug/zplug synced 2024-06-07 15:26:12 +02:00

Merge pull request #358 from zplug/fix-343

Cache clear automatically after running install/update command
This commit is contained in:
zplug-man 2017-01-10 20:04:14 +09:00 committed by GitHub
commit 063d26f800
2 changed files with 16 additions and 2 deletions

View File

@ -3,7 +3,7 @@ __zplug::job::parallel::init()
local caller="${${(M)funcstack[@]:#__*__}:gs:_:}"
local is_parallel=false is_select=false
local filter repo starting_message
local -aU repos
local -aU repos status_ok
repos=( "$argv[@]" )
@ -128,6 +128,12 @@ __zplug::job::parallel::deinit()
fi
# Run rollback if hook-build failed
__zplug::job::rollback::message
# Cache clear automatically after running update command
status_ok=( ${(@f)"$(cat "$_zplug_log[update]" 2>/dev/null \
| __zplug::utils::awk::ltsv 'key("status")==0')"} )
if (( $#status_ok > 0 )); then
__zplug::core::core::run_interfaces 'clear'
fi
;;
install)
if (( ${(k)#status_codes[(R)$_zplug_status[failure]]} == 0 )); then
@ -144,6 +150,12 @@ __zplug::job::parallel::deinit()
fi
# Run rollback if hook-build failed
__zplug::job::rollback::message
# Cache clear automatically after running install command
status_ok=( ${(@f)"$(cat "$_zplug_log[install]" 2>/dev/null \
| __zplug::utils::awk::ltsv 'key("status")==0')"} )
if (( $#status_ok > 0 )); then
__zplug::core::core::run_interfaces 'clear'
fi
;;
status)
if (( ${(k)#status_codes[(R)$_zplug_status[out_of_date]]} == 0 )); then

View File

@ -68,7 +68,9 @@ __zplug::utils::git::clone()
fi
# The revison (hash/branch/tag) lock
__zplug::utils::git::checkout "$repo"
# NOTE: Since it's logged in `__zplug::utils::git::checkout` function,
# there is no problem even if it's discarded /dev/null file here
__zplug::utils::git::checkout "$repo" &>/dev/null
if (( $ret == 0 )); then
return $_zplug_status[success]