Skip to content

Commit d76b3d7

Browse files
committed
Warning if there are multiple matches from environment variable
1 parent 20ddd2a commit d76b3d7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

share/sh_functions/__tykky_get_env_path

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ __tykky_get_env_path() {
1515
for __tykky_path in ${TYKKY_PATH:-""}; do
1616
IFS=$oldIFS
1717
if [ -d "$__tykky_path/$1" ]; then
18-
__candidate="${__tykky_path%/}/${1%/}"
19-
break
18+
if [ -n "$__candidate" ]; then
19+
echo "WARNING: Additional candidate tykky environments found in TYKKY_PATH for $1, only the first one will be considered" >&2
20+
echo -e "\tfirst candidate: $__candidate" >&2
21+
echo -e "\tnew candidate: $__tykky_path/$1" >&2
22+
else
23+
__candidate="${__tykky_path%/}/${1%/}"
24+
fi
25+
#break
2026
fi
2127
done
2228
if [ -d "$1" ];then

0 commit comments

Comments
 (0)