mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 06:31:13 -03:00
tests/fish_config: share logic between standalone and installed builds
This commit is contained in:
@@ -4,8 +4,7 @@ function __fish_data_with_file
|
||||
set -l cmd $argv[2..]
|
||||
if set -q __fish_data_dir[1]
|
||||
if not string match -rq -- ^/ $path
|
||||
echo >&2 "error: $(status function) requires absolute paths on non-embedded builds"
|
||||
return 1
|
||||
set path $__fish_data_dir/$path
|
||||
end
|
||||
$cmd $path
|
||||
else
|
||||
|
||||
@@ -126,10 +126,8 @@ fish_config theme show | grep -E 'fish default|Default Dark|custom-from-userconf
|
||||
# CHECK: {{.*}}fish default{{\x1b\[m}}
|
||||
|
||||
# Override a default theme with different colors.
|
||||
{
|
||||
status get-file tools/web_config/themes/None.theme 2>/dev/null ||
|
||||
cat $__fish_data_dir/tools/web_config/themes/None.theme
|
||||
} >$__fish_config_dir/themes/"fish default.theme"
|
||||
__fish_data_with_file tools/web_config/themes/None.theme \
|
||||
cat >$__fish_config_dir/themes/"fish default.theme"
|
||||
fish_config theme show | grep -E 'fish default|Base16 Default Dark' -A1
|
||||
# CHECK: {{\x1b\[m}}{{\x1b\[4m}}fish default{{\x1b\[m}}
|
||||
# CHECK: {{\x1b\[m}}/bright/vixens{{\x1b\[m}} {{\x1b\[m}}jump{{\x1b\[m}}{{.*}}
|
||||
|
||||
Reference in New Issue
Block a user