mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Optimize structure/layout of __fish_print_packages
Move XDG_CACHE_HOME logic below package providers that don't use the cache.
This commit is contained in:
parent
1c4940c04c
commit
4b78c92652
1 changed files with 8 additions and 6 deletions
|
@ -12,12 +12,6 @@ function __fish_print_packages
|
|||
#Get the word 'Package' in the current language
|
||||
set -l package (_ "Package")
|
||||
|
||||
# Set up cache directory
|
||||
if test -z "$XDG_CACHE_HOME"
|
||||
set XDG_CACHE_HOME $HOME/.cache
|
||||
end
|
||||
mkdir -m 700 -p $XDG_CACHE_HOME
|
||||
|
||||
if type -q -f apt-cache
|
||||
# Do not generate the cache as apparently sometimes this is slow.
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
|
||||
|
@ -42,6 +36,14 @@ function __fish_print_packages
|
|||
return
|
||||
end
|
||||
|
||||
### BEGIN CACHED RESULTS ###
|
||||
|
||||
# Set up cache directory
|
||||
if test -z "$XDG_CACHE_HOME"
|
||||
set XDG_CACHE_HOME $HOME/.cache
|
||||
end
|
||||
mkdir -m 700 -p $XDG_CACHE_HOME
|
||||
|
||||
# Caches for 5 minutes
|
||||
if type -q -f pacman
|
||||
set cache_file $XDG_CACHE_HOME/.pac-cache.$USER
|
||||
|
|
Loading…
Reference in a new issue