File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,29 @@ __tykky_get_env_path() {
19
19
break
20
20
fi
21
21
done
22
-
22
+ if [ -d "$1" ];then
23
+ # If there is a matching foldername in the current directory
24
+ # and the name does not match anyhing in tykky_path, also test that for convinience
25
+ # this is to be consistent with that the first case allows relative paths
26
+ # so then relative paths in the current directory withouth / should also work
27
+ if [ -z "$__candidate" ];then
28
+ __candidate=$PWD/$1
29
+
30
+ # Ambiguous reference as we might have multiple matches
31
+ else
32
+ _tp_candidate=$(readlink -f $__candidate)
33
+ _d_candidate=$(readlink -f $1)
34
+ # if same folder let's not emit a warning
35
+ # following pseudo standard -> command line arguments override environment settings
36
+ if [ ! "$_tp_candidate" = "$_d_candidate" ];then
37
+ echo "WARNING: Multiple candidate tykky environments for $1, activating the one in the current directory" >&2
38
+ echo -e "\tfrom TYKKY_PATH: $_tp_candidate" >&2
39
+ echo -e "\tfrom current directory: $_d_candidate" >&2
40
+ fi
41
+
42
+ fi
43
+ fi
44
+
23
45
;;
24
46
esac
25
47
@@ -30,6 +52,10 @@ __tykky_get_env_path() {
30
52
else
31
53
unset __candidate __tykky_path
32
54
echo "ERROR: $1 is not a valid tykky environment" >&2
55
+ if [ ! -d "$1" ] ; then
56
+ echo -e "\t$1 does not exists or parent folder is not in TYKKY_PATH" >&2
57
+ echo -e "\tCurrent value: TYKKY_PATH=$TYKKY_PATH" >&2
58
+ fi
33
59
false
34
60
fi
35
61
You can’t perform that action at this time.
0 commit comments