fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
440e7fcbc
master
1# RUN: fish=%fish %fish %s 2# REQUIRES: %fish -c "not cygwin_nosymlinks" 3 4# fish_variables 5set -l target_file$XDG_CONFIG_HOME /fish/target_fish_variables 6set -l fish_variables$XDG_CONFIG_HOME /fish/fish_variables 7set -l backup_file$XDG_CONFIG_HOME /fish/fish_variables_backup 8 9echo > $target_file 10cp $target_file $backup_file 11ln -sf$target_file $fish_variables 12$fish -c'set -U variable value' 13 14if not test -L $fish_variables 15echo fish_variables has been overwritten 16else if cmp $target_file $backup_file > /dev/null 17echo fish_variables was never written 18else 19echo fish_variables is still a symlink 20end 21# CHECK: fish_variables is still a symlink 22rm $fish_variables 23 24# fish_history 25set -l history_file$XDG_DATA_HOME /fish/fish_history 26set -l target_file$XDG_DATA_HOME /fish/target_fish_history 27set -l backup_file$XDG_DATA_HOME /fish/fish_history_backup 28 29echo '- cmd: echo I will be deleted from history 30when: 1614577746' > $target_file 31cp $target_file $backup_file 32ln -sf$target_file $history_file 33# The one way to ensure non-interactive fish writes to the history file 34$fish -c'echo all | history delete deleted | grep echo' 35# CHECK: [1] echo I will be deleted from history 36 37if not test -L $history_file 38echo fish_history has been overwritten 39else if cmp $target_file $backup_file &> /dev/null 40# cmp writes to stderr when one file is empty, thus &> above 41echo fish_history was never written 42else 43echo fish_history is still a symlink 44end 45# CHECK: fish_history is still a symlink 46rm $history_file