diff options
author | Doron Behar <doron.behar@gmail.com> | 2019-07-24 18:28:23 +0300 |
---|---|---|
committer | Oliver Kiddle <okiddle@yahoo.co.uk> | 2019-09-27 00:34:30 +0200 |
commit | 6711985b4bff41f622d96e02f7dc62485f21fe3c (patch) | |
tree | 80bd6abffd14b87172f50a9ff1ee9c59e969dd36 /Completion/Unix/Command/_luarocks | |
parent | 4f48ce208b89b0790f113642aab200a65abf7816 (diff) | |
download | zsh-6711985b4bff41f622d96e02f7dc62485f21fe3c.tar.gz zsh-6711985b4bff41f622d96e02f7dc62485f21fe3c.tar.xz zsh-6711985b4bff41f622d96e02f7dc62485f21fe3c.zip |
gitlab !11: luarocks: Fix/improve logic of cache validation
Also: Remove unnecessary quoting of helper function calls.
Diffstat (limited to 'Completion/Unix/Command/_luarocks')
-rw-r--r-- | Completion/Unix/Command/_luarocks | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks index 5c8ebdc92..c73a75a03 100644 --- a/Completion/Unix/Command/_luarocks +++ b/Completion/Unix/Command/_luarocks @@ -173,16 +173,16 @@ ___luarocks_installed_rocks_cache_policy(){ local user_manifest_file="${configured_user_tree}/lib/luarocks/rocks-${configured_lua_version}/manifest" local system_manifest_file="${configured_system_tree}/lib/luarocks/rocks-${configured_lua_version}/manifest" - local cache_status=1 + local cache_status=0 if [[ -f ${cache_file} ]]; then if [[ -f ${user_manifest_file} ]]; then - if [[ ${user_manifest_file} -nt ${cache_file} ]]; then - cache_status=0 + if [[ ${cache_file} -nt ${user_manifest_file} ]]; then + cache_status=1 fi fi if [[ -f ${system_manifest_file} ]]; then - if [[ ${system_manifest_file} -nt ${cache_file} ]]; then - cache_status=0 + if [[ ${cache_file} -nt ${system_manifest_file} ]]; then + cache_status=1 fi fi fi @@ -402,7 +402,7 @@ local doc_command_options=( _luarocks_doc(){ _arguments \ "${doc_command_options[@]}" \ - '1: :{__luarocks_rock "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed ${opt_args[--tree]}}" } # arguments: # - must: external only rockspec @@ -524,8 +524,8 @@ local remove_command_options=( _luarocks_remove(){ _arguments -A "-*" \ "${remove_command_options[@]}" \ - '1: :{__luarocks_rock "installed" '"${opt_args[--tree]}"'}' \ - '2:: :{__luarocks_rock_version "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed ${opt_args[--tree]}}" \ + "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" } # arguments: # - must: string as a search query @@ -558,8 +558,8 @@ local show_command_options=( _luarocks_show(){ _arguments \ "${show_command_options[@]}" \ - "1: :{__luarocks_rock 'installed' "${opt_args[--tree]}"}" \ - '2:: :{__luarocks_rock_version "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed "${opt_args[--tree]}"}" \ + "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" } (( $+functions[_luarocks_test] )) || |