mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-12 14:51:16 -03:00
The __fish_data_with_file wrapper was born out of a desire to simplify handling of file paths that may or may not be embedded into the fish binary. Since95aeb16ca2(Remove embed-data feature flag, 2025-11-20) this is no longer needed since almost everything is embedded unconditionally. The exception is man pages (seea1baf97f54(Do not embed man pages in CMake builds, 2025-11-20)), but they use __fish_data_with_directory.
22 lines
903 B
Fish
22 lines
903 B
Fish
# RUN: %fish %s
|
|
|
|
touch $__fish_config_dir/functions/delta-test-custom-function.fish
|
|
for path in fish_greeting fish_job_summary
|
|
status get-file functions/$path.fish >$__fish_config_dir/functions/$path.fish
|
|
end
|
|
set -l tmp (sed 's/$/ # Modified/' $__fish_config_dir/functions/fish_greeting.fish)
|
|
string join -- \n $tmp >$__fish_config_dir/functions/fish_greeting.fish
|
|
|
|
fish_delta --no-diff --new |
|
|
string match -r '.*\b(?:delta-test|fish_greeting|fish_job_summary)\b.*'
|
|
# CHECK: New: {{.*}}/fish/functions/delta-test-custom-function.fish
|
|
# CHECK: Changed: {{.*}}/fish/functions/fish_greeting.fish
|
|
# CHECK: Unmodified: {{.*}}/fish/functions/fish_job_summary.fish
|
|
|
|
fish_delta | grep -A1 '\bfunction fish_greeting\b'
|
|
# CHECK: -function fish_greeting
|
|
# CHECK: - if not set -q fish_greeting
|
|
# CHECK: --
|
|
# CHECK: +function fish_greeting # Modified
|
|
# CHECK: + if not set -q fish_greeting # Modified
|