mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Speed up __fish_make_cache_dir
Don't fork/exec an external process, especially one performing IO, if we don't have to. This, in turn, speeds up __fish_source_cached_completions which is rather slow under WSL (and slower than it needs to be on other platforms).
This commit is contained in:
parent
98642d307a
commit
e1ee193822
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@ function __fish_make_cache_dir --description "Create and return XDG_CACHE_HOME"
|
||||||
# If we get an argument, we try to create that as a subdirectory.
|
# If we get an argument, we try to create that as a subdirectory.
|
||||||
# So if you call `__fish_make_cache_dir completions`,
|
# So if you call `__fish_make_cache_dir completions`,
|
||||||
# this creates e.g. ~/.cache/fish/completions
|
# this creates e.g. ~/.cache/fish/completions
|
||||||
mkdir -m 700 -p $xdg_cache_home/fish/"$argv[1]"
|
if not path is -d $xdg_cache_home/fish/"$argv[1]"
|
||||||
and echo $xdg_cache_home/fish/"$argv[1]"
|
mkdir -m 700 -p $xdg_cache_home/fish/"$argv[1]"
|
||||||
|
end; and echo $xdg_cache_home/fish/"$argv[1]"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue