mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 04:41:15 -03:00
__fish_data_list_files: fix for installed builds
This is only used in test code where bad output is ignored. To be tested by a following commit.
This commit is contained in:
@@ -9,7 +9,7 @@ function __fish_data_list_files
|
||||
set dir $__fish_data_dir
|
||||
end
|
||||
set -l files $dir/**
|
||||
string replace -- $dir/ '' $files
|
||||
string replace -- $__fish_data_dir/ '' $files
|
||||
else
|
||||
status list-files $dir
|
||||
end
|
||||
|
||||
@@ -3,7 +3,11 @@ function __fish_data_with_file
|
||||
set -l path $argv[1]
|
||||
set -l cmd $argv[2..]
|
||||
if set -q __fish_data_dir[1]
|
||||
$cmd $__fish_data_dir/$path
|
||||
if not string match -rq -- ^/ $path
|
||||
echo >&2 "error: $(status function) requires absolute paths on non-embedded builds"
|
||||
return 1
|
||||
end
|
||||
$cmd $path
|
||||
else
|
||||
status get-file $path | $cmd
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user