[__sensible_editor] Improve error message when a basename of an editor not in the alternatives is provided

remotes/origin/build/support-pip-from-git
Dennis Camera 6 years ago
parent 3bbb7b02d2
commit 8b0734f719
  1. 11
      cdist/conf/type/__sensible_editor/explorer/editor_path

@ -78,17 +78,24 @@ then
if ! $is_abspath if ! $is_abspath
then then
# First, try to resolve the absolute path using $editors. # First, try to resolve the absolute path using $editors.
while true
do
for e in $editors for e in $editors
do do
if test "$(basename "${e}")" = "${editor}" if test "$(basename "${e}")" = "${editor}"
then then
editor="${e}" editor="${e}"
break break 2 # break out of both loops
fi fi
done done
# Iterating through alternatives did not yield a result
editor_no_alternative "${editor}"
break
done
fi fi
# Check if path is present # Check if editor is present
test -f "${editor}" || editor_missing "${editor}" test -f "${editor}" || editor_missing "${editor}"
for e in $editors for e in $editors

Loading…
Cancel
Save