mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-15 09:21:15 -03:00
fish_update_completions: pass explicit directory argument
Gets rid of another use of XDG_CACHE_HOME; this gets us closer to a single source of truth. Not super important right now, but will be helpful if we allow users to override XDG_CACHE_HOME in future. I guess we could also remove it from create_manpage_completions.py, that's unnecessary breakage but probably fine since this is not public-facing.
This commit is contained in:
@@ -16,9 +16,9 @@ function fish_update_completions --description "Update man-page based completion
|
||||
- \
|
||||
# Use the manpath
|
||||
--manpath \
|
||||
--directory=$__fish_cache_dir/generated_completions \
|
||||
# Clean up old completions
|
||||
--cleanup-in $__fish_user_data_dir/generated_completions \
|
||||
--cleanup-in $__fish_cache_dir/generated_completions
|
||||
--cleanup-in $__fish_user_data_dir/generated_completions
|
||||
|
||||
status get-file tools/create_manpage_completions.py |
|
||||
if $detach
|
||||
|
||||
@@ -2231,6 +2231,7 @@ if __name__ == "__main__":
|
||||
args.directory = os.path.expanduser(
|
||||
xdg_cache_home + "/fish/generated_completions/"
|
||||
)
|
||||
if not args.stdout:
|
||||
try:
|
||||
os.makedirs(args.directory)
|
||||
except OSError as e:
|
||||
|
||||
@@ -24,7 +24,7 @@ end each output line with NUL, not newline
|
||||
'
|
||||
|
||||
MANPATH=$PWD/man fish_update_completions
|
||||
# CHECK: Parsing man pages and writing completions to {{.*}}/generated_completions/
|
||||
# CHECK: Parsing man pages and writing completions to {{.*}}/generated_completions
|
||||
# CHECK: {{.*}} 1 / 1 : dirname.1{{.*}}
|
||||
|
||||
cd $__fish_cache_dir
|
||||
|
||||
Reference in New Issue
Block a user