Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
faho committed May 1, 2021
1 parent 238bbb6 commit a25ebdd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions share/functions/fish_config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,20 @@ function fish_config --description "Launch fish's web based configuration"
echo Overwriting
cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}

set -q argv[1]
and source $prompt_dir/$argv[1].fish
if set -q argv[1]
set -l have 0
for f in $prompt_dir/$argv[1].fish
if test -f $f
set have 1
source $f
or return 2
end
end
if test $have -eq 0
echo "No such prompt: '$argv[1]'" >&2
return 1
end
end

funcsave fish_prompt
or return
Expand Down

0 comments on commit a25ebdd

Please sign in to comment.