File tree Expand file tree Collapse file tree
src/artifacts-helper/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,4 +8,4 @@ if [ ! -d "${HOME}/.nuget/plugins/netcore" ]; then
88fi
99
1010DOTNET_EXE=" $( resolve_shim) "
11- VSS_NUGET_ACCESSTOKEN=" ${ARTIFACTS_ACCESSTOKEN:- } " VSS_NUGET_URI_PREFIXES=REPLACE_WITH_AZURE_DEVOPS_NUGET_FEED_URL_PREFIX ${NUGET_EXE } " $@ "
11+ VSS_NUGET_ACCESSTOKEN=" ${ARTIFACTS_ACCESSTOKEN:- } " VSS_NUGET_URI_PREFIXES=REPLACE_WITH_AZURE_DEVOPS_NUGET_FEED_URL_PREFIX ${DOTNET_EXE } " $@ "
Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ RESOLVE_SHIMS_IMPORTED=true
44
55resolve_shim () {
66 # Find the next non-shim executable in PATH so we do not run the shim again
7- shim_file=$( readlink -f " ${BASH_SOURCE[1]} " )
8- echo $( which -a dotnet | grep -vx " $shim_file " | head -n 1)
7+ shim_file=" $( readlink -f " ${BASH_SOURCE[1]} " ) "
8+ executable=" $( basename " $shim_file " ) "
9+
10+ # Read into array first to handle spaces properly
11+ readarray -t candidates < <( which -a " $executable " 2> /dev/null)
12+
13+ for candidate in " ${candidates[@]} " ; do
14+ # Skip any candidate which is a symlink to the shim file
15+ [[ " $( readlink -f " $candidate " ) " != " $shim_file " ]] && {
16+ echo " $candidate "
17+ return 0
18+ }
19+ done
20+
21+ return 1
922}
You can’t perform that action at this time.
0 commit comments