fish_config: Skip backing up prompt

This would print an ugly but benign error
This commit is contained in:
Fabian Boehm 2023-01-01 10:57:25 +01:00
parent 9e1c8a70bf
commit afd242b14d

View File

@ -106,7 +106,10 @@ function fish_config --description "Launch fish's web based configuration"
read -P"Overwrite prompt? [y/N]" -l yesno
if string match -riq 'y(es)?' -- $yesno
echo Overwriting
cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}
# Skip the cp if unnecessary,
# or we'd throw an error on a stock fish.
path is $__fish_config_dir/functions/fish_prompt.fish
and cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}
set -l have
if set -q argv[1]